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>
/* 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,