]> Git Repo - J-linux.git/commitdiff
pinctrl: rockchip: fix pinmux reset in rockchip_pmx_set
authorHuang-Huang Bao <[email protected]>
Thu, 6 Jun 2024 12:57:55 +0000 (20:57 +0800)
committerLinus Walleij <[email protected]>
Mon, 17 Jun 2024 08:36:56 +0000 (10:36 +0200)
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 <[email protected]>
Signed-off-by: Huang-Huang Bao <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Linus Walleij <[email protected]>
drivers/pinctrl/pinctrl-rockchip.c

index 24ee88863ce399b3c1e1997c6b40c741eb4860fd..3f56991f5b89203b0f74eb5ef13a031027faebd0 100644 (file)
@@ -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;
        }
This page took 0.058262 seconds and 4 git commands to generate.