Skip to content

Commit 45fe459

Browse files
krzklinusw
authored andcommitted
pinctrl: rockchip: Fix configuring a deferred pin
Commit e2c58cb ("pinctrl: rockchip: Simplify locking with scoped_guard()") added a scoped_guard() over existing code containing a "break" instruction. That "break" was for the outer (existing) for-loop, which now exits inner, scoped_guard() loop. If GPIO driver did not probe, then driver will not bail out, but instead continue to configure the pin. Fix the issue by simplifying the code - the break in original code was leading directly to end of the function returning 0, thus we can simply return here rockchip_pinconf_defer_pin status. Reported-by: David Lechner <[email protected]> Closes: https://lore.kernel.org/r/[email protected]/ Fixes: e2c58cb ("pinctrl: rockchip: Simplify locking with scoped_guard()") Signed-off-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
1 parent fd5bed7 commit 45fe459

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

drivers/pinctrl/pinctrl-rockchip.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3640,14 +3640,10 @@ static int rockchip_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
36403640
* or the gpio driver hasn't probed yet.
36413641
*/
36423642
scoped_guard(mutex, &bank->deferred_lock) {
3643-
if (!gpio || !gpio->direction_output) {
3644-
rc = rockchip_pinconf_defer_pin(bank,
3645-
pin - bank->pin_base,
3646-
param, arg);
3647-
if (rc)
3648-
return rc;
3649-
break;
3650-
}
3643+
if (!gpio || !gpio->direction_output)
3644+
return rockchip_pinconf_defer_pin(bank,
3645+
pin - bank->pin_base,
3646+
param, arg);
36513647
}
36523648
}
36533649

0 commit comments

Comments
 (0)