]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
power: regulator: common: use dm_gpio_is_valid helper
authorJulien Stephan <jstephan@baylibre.com>
Thu, 15 Jan 2026 14:30:44 +0000 (15:30 +0100)
committerPeng Fan <peng.fan@nxp.com>
Thu, 22 Jan 2026 02:01:10 +0000 (10:01 +0800)
Use dm_gpio_is_valid() helper function instead of manually checking the
gpio.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Tanmay Kathpalia <tanmay.kathpalia@altera.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
drivers/power/regulator/regulator_common.c

index ce3d80670de045dde7e263c5301bccd744abd2f5..cf98998579aa8a3cb7f09dccd2124207a58d8b00 100644 (file)
@@ -51,7 +51,7 @@ int regulator_common_get_enable(const struct udevice *dev,
        struct regulator_common_plat *plat)
 {
        /* Enable GPIO is optional */
-       if (!plat->gpio.dev)
+       if (!dm_gpio_is_valid(&plat->gpio))
                return true;
 
        return dm_gpio_get_value(&plat->gpio);