Commit 4ea4d480 authored by Huang-Huang Bao's avatar Huang-Huang Bao Committed by Linus Walleij

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: 14797189 ("pinctrl: rockchip: add return value to rockchip_set_mux")
Reviewed-by: default avatarHeiko Stuebner <heiko@sntech.de>
Signed-off-by: default avatarHuang-Huang Bao <i@eh5.me>
Link: https://lore.kernel.org/r/20240606125755.53778-5-i@eh5.meSigned-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 01b4b1d1
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment