From: Huang-Huang Bao <i@eh5.me>
To: Linus Walleij <linus.walleij@linaro.org>,
Heiko Stuebner <heiko@sntech.de>
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 <i@eh5.me>
Subject: [PATCH 3/3] pinctrl: rockchip: fix pinmux reset in rockchip_pmx_set
Date: Thu, 6 Jun 2024 14:04:35 +0800 [thread overview]
Message-ID: <20240606060435.765716-4-i@mail.eh5.me> (raw)
In-Reply-To: <20240606060435.765716-1-i@eh5.me>
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")
Signed-off-by: Huang-Huang Bao <i@eh5.me>
---
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;
}
--
2.45.2
next prev parent reply other threads:[~2024-06-06 6:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20240606060435.765716-1-i@eh5.me>
2024-06-06 6:04 ` [PATCH 1/3] pinctrl: rockchip: fix RK3328 pinmux bits Huang-Huang Bao
2024-06-06 10:08 ` Heiko Stübner
2024-06-06 11:25 ` Huang-Huang Bao
2024-06-06 6:04 ` [PATCH 2/3] pinctrl: rockchip: use dedicated pinctrl type for RK3328 Huang-Huang Bao
2024-06-06 9:43 ` Heiko Stübner
2024-06-06 10:11 ` Heiko Stübner
2024-06-06 6:04 ` Huang-Huang Bao [this message]
2024-06-06 9:51 ` [PATCH 3/3] pinctrl: rockchip: fix pinmux reset in rockchip_pmx_set Heiko Stübner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240606060435.765716-4-i@mail.eh5.me \
--to=i@eh5.me \
--cc=heiko@sntech.de \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).