]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
pinctrl: mediatek: ignored error return from pupd/r1/r0
authorDavid Lechner <dlechner@baylibre.com>
Wed, 14 Jan 2026 01:48:31 +0000 (19:48 -0600)
committerTom Rini <trini@konsulko.com>
Wed, 21 Jan 2026 19:29:28 +0000 (13:29 -0600)
Ignore the error return value from mtk_pinconf_bias_set_pupd_r1_r0().
The PUPD/R1/R0 registers only include a small subset of the pins, so
it is normal for this function to return an error for most pins.
Therefore, this error should not be propagated.

This fixes not all pins in a pinmux group being configured in some
cases because the propagated error caused the configuration loop to
exit early.

The rest of the function is refactored to return early on errors to
improve readability.

Signed-off-by: David Lechner <dlechner@baylibre.com>
drivers/pinctrl/mediatek/pinctrl-mtk-common.c

index 0483d532800212b26c9c37a09f40c7d28575f71d..ff7cefcc8de1726024f7ccf9fd493822ca49346d 100644 (file)
@@ -364,11 +364,13 @@ int mtk_pinconf_bias_set_v1(struct udevice *dev, u32 pin, bool disable,
        /* set pupd_r1_r0 if pullen_pullsel succeeded */
        err = mtk_pinconf_bias_set_pullen_pullsel(dev, pin, disable, pullup,
                                                  val);
-       if (!err)
-               return mtk_pinconf_bias_set_pupd_r1_r0(dev, pin, disable,
-                                                      pullup, val);
+       if (err)
+               return err;
 
-       return err;
+       /* Not all pins have PUPD/R1/R0 registers, so ignore any error here. */
+       mtk_pinconf_bias_set_pupd_r1_r0(dev, pin, disable, pullup, val);
+
+       return 0;
 }
 
 int mtk_pinconf_bias_set_pu_pd(struct udevice *dev, u32 pin, bool disable,