]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commitdiff
pinctrl: rockchip: Fix configuring a deferred pin
authorKrzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Mon, 23 Feb 2026 10:57:18 +0000 (11:57 +0100)
committerLinus Walleij <linusw@kernel.org>
Tue, 24 Feb 2026 09:51:30 +0000 (10:51 +0100)
Commit e2c58cbe3aff ("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 <dlechner@baylibre.com>
Closes: https://lore.kernel.org/r/f5b38942-a584-4e78-a893-de4a219070b2@baylibre.com/
Fixes: e2c58cbe3aff ("pinctrl: rockchip: Simplify locking with scoped_guard()")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
drivers/pinctrl/pinctrl-rockchip.c

index d87c0b1de616dfd2cc960483a894cc3eb90f7188..f15b18f334ee0eaf1ab0f0d214a61dc390da3051 100644 (file)
@@ -3640,14 +3640,10 @@ static int rockchip_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
                         * or the gpio driver hasn't probed yet.
                         */
                        scoped_guard(mutex, &bank->deferred_lock) {
-                               if (!gpio || !gpio->direction_output) {
-                                       rc = rockchip_pinconf_defer_pin(bank,
-                                                                       pin - bank->pin_base,
-                                                                       param, arg);
-                                       if (rc)
-                                               return rc;
-                                       break;
-                               }
+                               if (!gpio || !gpio->direction_output)
+                                       return rockchip_pinconf_defer_pin(bank,
+                                                                         pin - bank->pin_base,
+                                                                         param, arg);
                        }
                }