Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1559718pxu; Tue, 24 Nov 2020 03:29:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJwt+owCKDlwPcxa0UCJ248To8d9qa5RsjJVRzijZaenzPxMCM5+9MYns9fpQpKZclM4DivQ X-Received: by 2002:a17:906:b0f:: with SMTP id u15mr3745711ejg.109.1606217341266; Tue, 24 Nov 2020 03:29:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606217341; cv=none; d=google.com; s=arc-20160816; b=CDDjliMixQkrbSlLQvBsm+2XF3PofFob+mV5XlNvnzckLtDPVJGNBbSUbf4svwfF+u 94XK6i1Do4E7qmBKV+qQMTTjQa9ev8mqi7FCdQX1ugSU8yFv6KzSzpRnwfpRliHkmPkp KeXkgmZl11KTdofaTnlW2/VUb6KTZorsXBSGsH/1Zr4Ua/SvH6k3hI145az2zzjudDkg OaTDqreb3IJGpY3tiysGE1l1jHPwK+XpStzKH2CE8iFqLTgoAwysYatRlSmqqNB+KF0L HupO7YQ9etnznSsBfG8kMGtsEMGzp1qFijP2DWNbbJzBeKTJejOJB3jmkeFBgNRlDf1Q g8DA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=d2hAv/dYxqnH9kC7IHS0GqCqxKskZQoAxg4mVm0j5d4=; b=tgNgYcFnnAAdCVNRVpThhJTYZhHEvutU/+Zh6gwHx10BRgMYWPLM5cc5TbF2fGSu6n mui5kVEPpXRmLGHBzgLvpEiFZhi7brcoTZHOc9+lOxt9OG3ZhX5ELJ44/i6SMaKcQTRH LXTMzhfNQRZRJAm6vwBTC1jGpHmwuQgUBY1g9WTM1onyHVfIboi6ibFCnSM/9oxK45HY p048AdD2JijEglcPK4QcFZOXvYQqWrZzaISr558K7Aqg1R2trGZtX0bXv7KN8WrqSlbn tQUsS2thhvqT+8zpTgXLZOI4yZFlmKCCjePjN1kIxpillKAKiQR6L+PwBo2e7kxnXwD9 niVw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o24si681488edz.608.2020.11.24.03.28.38; Tue, 24 Nov 2020 03:29:01 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732673AbgKXL0K (ORCPT + 99 others); Tue, 24 Nov 2020 06:26:10 -0500 Received: from relmlor1.renesas.com ([210.160.252.171]:44147 "EHLO relmlie5.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732658AbgKXL0J (ORCPT ); Tue, 24 Nov 2020 06:26:09 -0500 X-IronPort-AV: E=Sophos;i="5.78,366,1599490800"; d="scan'208";a="63718439" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 24 Nov 2020 20:26:08 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 6AE444362273; Tue, 24 Nov 2020 20:26:06 +0900 (JST) From: Lad Prabhakar To: Sergei Shtylyov , Krzysztof Kozlowski , Philipp Zabel , Jiri Kosina , Mark Brown Cc: linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Biju Das , Prabhakar , Lad Prabhakar , stable@vger.kernel.org Subject: [PATCH 1/5] memory: renesas-rpc-if: Return correct value to the caller of rpcif_manual_xfer() Date: Tue, 24 Nov 2020 11:25:48 +0000 Message-Id: <20201124112552.26377-2-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201124112552.26377-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20201124112552.26377-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Cc: stable@vger.kernel.org --- drivers/memory/renesas-rpc-if.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/memory/renesas-rpc-if.c b/drivers/memory/renesas-rpc-if.c index f2a33a1af836..69f2e2b4cd50 100644 --- a/drivers/memory/renesas-rpc-if.c +++ b/drivers/memory/renesas-rpc-if.c @@ -508,7 +508,8 @@ int rpcif_manual_xfer(struct rpcif *rpc) 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; } -- 2.17.1