summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorHuang-Huang Bao <i@eh5.me>2024-06-06 20:57:55 +0800
committerLinus Walleij <linus.walleij@linaro.org>2024-06-17 10:36:56 +0200
commit4ea4d4808e342ddf89ba24b93ffa2057005aaced (patch)
treee7b2ffaa725bd007719c11c51e0a7726becae2e6 /drivers
parent01b4b1d1cec48ef4c26616c2fc4600b2c9fec05a (diff)
downloadlinux-stable-4ea4d4808e342ddf89ba24b93ffa2057005aaced.tar.gz
linux-stable-4ea4d4808e342ddf89ba24b93ffa2057005aaced.tar.bz2
linux-stable-4ea4d4808e342ddf89ba24b93ffa2057005aaced.zip
pinctrl: rockchip: fix pinmux reset in rockchip_pmx_set
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 <heiko@sntech.de> Signed-off-by: Huang-Huang Bao <i@eh5.me> Link: https://lore.kernel.org/r/20240606125755.53778-5-i@eh5.me Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/pinctrl/pinctrl-rockchip.c4
1 files changed, 3 insertions, 1 deletions
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;
}