Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1156216pxu; Fri, 27 Nov 2020 00:42:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJxIxylg3thG2vqvuQf35FOa/IJS5yf/B4jflbFshb1c3ZAWB1f0Hgz87mX7/zPgUepcaxnf X-Received: by 2002:a17:906:6947:: with SMTP id c7mr6565464ejs.512.1606466541814; Fri, 27 Nov 2020 00:42:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606466541; cv=none; d=google.com; s=arc-20160816; b=Lu2GpiR8W5PZii9y0KHB+WTDgFdcROvuObJNU4x8gYPRpYXq/DBkp3wPDBP36xV2La qMPIDrwds/k7PSZ+KZ6l/qQwaEZd0zWy5o/j+qvqj0UwGiPLMQv3hfj5IvuhorOzQkRu AOA3gf5iLIOR2wRLXchIYWFcCJN+Luqdm2aGwbWXqV2zoISoWToHaV1WPFUQYu2Zfi/L DWZh8o2tU1o1HdcVTdhzBmAIJaAdG4DPjaiEhq//forPJCqwxKD/g8Zd3M43BOUAmZhX P39dTN9NIsc/yBKKPz8dXdBNAEK+/cxHA8dpCINeptCEF4RCNOtVwSDg/Hj5/mMzQYn1 firw== 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=doATd++G9oI+ajvVYgZvfnpp8UoWu41hLbNmki+p/IU=; b=ItagtPLInLZ0o0gylv9g1uxwcPbCLUPuI9wV0aI9/oVcNPG+c8s0kI9TywaK6KPlFM ZG8MLFhh8YbjgOt2nPmYiGBRoPrkTQkjzCEaJDKUgXz/ZrioYFmySWo5diHk8ubPewNK l8ArZ0ScIuFORc3vmHO6G+4EbcnEahOtUMhJ7Q8tHp1O25TnK/Nr9qOtdsU/Yp4I4r3h A2igv3lay74+g+YoBCfRWFqira/TuOVowujS0Nw7JZkW9Bgl2K6OyrR44DNCs1cdHvJs hyrmLxBk3oCDpJuyqHezX8uSXaYALyaYoSYcZQlI3L/lq0F1++a2OFpkO6UONdlwG1MO t+GQ== 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 p21si4732281edw.573.2020.11.27.00.41.59; Fri, 27 Nov 2020 00:42: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; 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 S2405205AbgKZTL5 (ORCPT + 99 others); Thu, 26 Nov 2020 14:11:57 -0500 Received: from relmlor1.renesas.com ([210.160.252.171]:49537 "EHLO relmlie5.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2405176AbgKZTL5 (ORCPT ); Thu, 26 Nov 2020 14:11:57 -0500 X-IronPort-AV: E=Sophos;i="5.78,372,1599490800"; d="scan'208";a="64008832" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 27 Nov 2020 04:11:55 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 85F1440F8AD9; Fri, 27 Nov 2020 04:11:53 +0900 (JST) From: Lad Prabhakar To: Sergei Shtylyov , Krzysztof Kozlowski , Philipp Zabel , Jiri Kosina , Mark Brown , linux-renesas-soc@vger.kernel.org, Pavel Machek , Geert Uytterhoeven Cc: linux-kernel@vger.kernel.org, Prabhakar , Lad Prabhakar , stable@vger.kernel.org Subject: [PATCH v2 1/5] memory: renesas-rpc-if: Return correct value to the caller of rpcif_manual_xfer() Date: Thu, 26 Nov 2020 19:11:42 +0000 Message-Id: <20201126191146.8753-2-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201126191146.8753-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20201126191146.8753-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 Reviewed-by: Sergei Shtylyov --- 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.25.1