Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9102055pxu; Mon, 28 Dec 2020 06:41:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJxllHeDGXpU4NRKgysW+oOxUABn+yvK5wXafRFrGEl7f3r0x6q7fjvpVI3faks8v08Fn17d X-Received: by 2002:a50:d757:: with SMTP id i23mr42696587edj.116.1609166481044; Mon, 28 Dec 2020 06:41:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609166481; cv=none; d=google.com; s=arc-20160816; b=dmD7Y04hx8xG0SDJ0psOZWrpIrgCa3FC2+ifyUrGovWzLUUNCSNtqYtWGww3MaZqB9 5LC3Id968qRFvaydSZVSR8AdU2puL7NMoaWBpK9PKnuNoen3agDSPX6zp0vykEY6W2Sy UmZZ74N1I91amPqn6oobL+Lvm3FAk4rFQub8BjGWoQ+4SsYVtefPIC8OoaBur2jF0CgM nD49JzN6vVrBZX7PhB4SqlAdhf+yv6ZbATmgjYih6n6CHsGCsUIQ/QqtBfa7Wpln62ZM QmrMCZmKfv442tbQpwdl50Xb0Yr8u8McOwn9UxqIh2D+5WgslkTYwdO/W0kLlOLDvWV0 1YrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ZypZZFATGcBSzCSZe6j7FD9IwPFNS0kL8o6gKGsYfCA=; b=TnO095neuBA8abxMe8sJt+6T0+Mq6h+aMtx0AAgh5a3+POwkjnuF4/lWXycC8lG2r/ n87W/LGWrcuWQXoM9YEjluHgwl/2H7yG1+W7lb17z3cyB7vavZNq9oUDaNeZ1DCksHDC K9YxJSSItSqJJz9e56pBZirzfct5uZnmFeLUGtuNzPhIODcC6RbPCxbtbwBbp7C21EQK xcZkajPZctj64beAjg/x30SLqJPNtFWRQCBMgTI9dkCG4UIE9fJx0BjEUfjISebETPpF smpqpPaaySBEWNR/gtPwgdUeENO0Xs11vwuTN3erY1rK8e11qIBAxEOO9NIcf8PB5FJI 9JKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ouOOfjDn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id md2si15931247ejb.699.2020.12.28.06.40.58; Mon, 28 Dec 2020 06:41:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ouOOfjDn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2504904AbgL1OdJ (ORCPT + 99 others); Mon, 28 Dec 2020 09:33:09 -0500 Received: from mail.kernel.org ([198.145.29.99]:40716 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2504793AbgL1Ocp (ORCPT ); Mon, 28 Dec 2020 09:32:45 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 542DE20791; Mon, 28 Dec 2020 14:32:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609165924; bh=oEpAsOXC8JAkhskm4KmIIR73+oZa6SuIWEHqgz7/hek=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ouOOfjDnlgu2ceX+5bbGEndA0GrjTrhVKap/SAnlrIBqjJ1yZhB5KU9COPhCfq7eZ TBJWQ8vZKukQ7WRKg6Y0G/mk8R92XWXo7omxOamZsq7neFhmla7Eqw7gJqBA/BL6R7 a/tN33w8GVx/NbtjLUhCy0A1jymyo9sF6BQN+FbM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pavel Machek , Lad Prabhakar , Sergei Shtylyov , Geert Uytterhoeven , Krzysztof Kozlowski Subject: [PATCH 5.10 703/717] memory: renesas-rpc-if: Return correct value to the caller of rpcif_manual_xfer() Date: Mon, 28 Dec 2020 13:51:41 +0100 Message-Id: <20201228125054.665891197@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lad Prabhakar commit a0453f4ed066cae651b3119ed11f52d31dae1eca upstream. In the error path of rpcif_manual_xfer() the value of ret is overwritten by value returned by reset_control_reset() function and thus returning incorrect value to the caller. This patch makes sure the correct value is returned to the caller of rpcif_manual_xfer() by dropping the overwrite of ret in error path. Also now we ignore the value returned by reset_control_reset() in the error path and instead print a error message when it fails. Fixes: ca7d8b980b67f ("memory: add Renesas RPC-IF driver") Reported-by: Pavel Machek Signed-off-by: Lad Prabhakar Reviewed-by: Sergei Shtylyov Reviewed-by: Geert Uytterhoeven Reviewed-by: Pavel Machek (CIP) Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20201126191146.8753-2-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Krzysztof Kozlowski Signed-off-by: Greg Kroah-Hartman --- drivers/memory/renesas-rpc-if.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/memory/renesas-rpc-if.c +++ b/drivers/memory/renesas-rpc-if.c @@ -508,7 +508,8 @@ exit: return ret; err_out: - ret = reset_control_reset(rpc->rstc); + if (reset_control_reset(rpc->rstc)) + dev_err(rpc->dev, "Failed to reset HW\n"); rpcif_hw_init(rpc, rpc->bus_size == 2); goto exit; }