summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Lechner <[email protected]>2026-01-13 19:48:31 -0600
committerTom Rini <[email protected]>2026-01-21 13:29:28 -0600
commit2d665b9cd361c4b6d100d3b1b5bdb6e0d1725486 (patch)
tree571fcaad6832c3a697e7c995e07235f3c0015e87
parente63e2e797e3ccf85a8394425e954c06e435c161c (diff)
pinctrl: mediatek: ignored error return from pupd/r1/r0
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 <[email protected]>
-rw-r--r--drivers/pinctrl/mediatek/pinctrl-mtk-common.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
index 0483d532800..ff7cefcc8de 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
@@ -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,