From patchwork Thu Jun 6 12:57:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huang-Huang Bao X-Patchwork-Id: 13688437 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 64528C27C54 for ; Thu, 6 Jun 2024 12:58:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9f2mErtIiwg/+s27dH25TQR37azBHYpkF2i1ShVAGXE=; b=yQgj78x+mCMNAW OU4KRYe+PL5xcvhBTV+CXr5rB6lS0riQc+dSKjvCmxGWgNCUPtKyhlMvLQlYD4zSoW++TtHEA7Zhd POaNAVNeTZF1UCncgZgYjaXghT/bRCPzoydQH1tMzRVG9tkcHIIhzwRNuuYYZwIZbfGikTu5b0OZO 0P6QKJrx4Q4oJULYxcvK7cOKEyLEqUIvNUGDACQ2bRY+z8Pqc9wt0c5/hOL6fOPlpfOdByGfhX3Tq /aAF6pzT2pFLXHtg2vXNlH5rEkd/1MZLmys7Lm9paJplKGz3+Ew9dK8o6xOJUEz/xylZw4quevUaX 7+cx7ukFYqEBGhHXzQEw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sFChC-00000009lb3-0ptz; Thu, 06 Jun 2024 12:58:22 +0000 Received: from mail.eh5.me ([45.76.111.223]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sFCh0-00000009lSk-47rW; Thu, 06 Jun 2024 12:58:12 +0000 From: Huang-Huang Bao DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eh5.me; s=dkim; t=1717678689; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aHzfbCHuap4cxwq/iZevfqON/k/0kct/7NXKtBKj9d4=; b=ybEJeoSAIAuQTp3QZIKYIgmz0J3/KIgn15jDFz/ErksFABXunAGcm8rVMNNZUZ9AEIzcwH D0ONwIX9BIEZtQ873j+zrFf46vaOCQ20+q5ZQdm1hV7uDlLCgyxvns+bYgdP5IAE/0UNoV YbVaE3NPqJq1FTPd6C4R0Dynk3A7WRU= To: Heiko Stuebner , Linus Walleij Cc: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Huang-Huang Bao Subject: [PATCH v2 4/4] pinctrl: rockchip: fix pinmux reset in rockchip_pmx_set Date: Thu, 6 Jun 2024 20:57:55 +0800 Message-ID: <20240606125755.53778-5-i@eh5.me> In-Reply-To: <20240606125755.53778-1-i@eh5.me> References: <20240606125755.53778-1-i@eh5.me> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240606_055811_224184_89066CBB X-CRM114-Status: UNSURE ( 9.88 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org rockchip_pmx_set reset all pinmuxs in group to 0 in the case of error, add missing bank data retrieval in that code to avoid setting mux on unexpected pins. Fixes: 14797189b35e ("pinctrl: rockchip: add return value to rockchip_set_mux") Reviewed-by: Heiko Stuebner Signed-off-by: Huang-Huang Bao --- drivers/pinctrl/pinctrl-rockchip.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c index 24ee88863ce3..3f56991f5b89 100644 --- a/drivers/pinctrl/pinctrl-rockchip.c +++ b/drivers/pinctrl/pinctrl-rockchip.c @@ -2751,8 +2751,10 @@ static int rockchip_pmx_set(struct pinctrl_dev *pctldev, unsigned selector, if (ret) { /* revert the already done pin settings */ - for (cnt--; cnt >= 0; cnt--) + for (cnt--; cnt >= 0; cnt--) { + bank = pin_to_bank(info, pins[cnt]); rockchip_set_mux(bank, pins[cnt] - bank->pin_base, 0); + } return ret; }