From: Julien Stephan Date: Thu, 15 Jan 2026 14:30:44 +0000 (+0100) Subject: power: regulator: common: use dm_gpio_is_valid helper X-Git-Tag: v2026.04-rc1~10^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0411cac1616c5ac3223367e054f4e8eb3ad524bc;p=thirdparty%2Fu-boot.git power: regulator: common: use dm_gpio_is_valid helper Use dm_gpio_is_valid() helper function instead of manually checking the gpio. Reviewed-by: Peng Fan Reviewed-by: Tanmay Kathpalia Reviewed-by: Neil Armstrong Signed-off-by: Julien Stephan Signed-off-by: Peng Fan --- diff --git a/drivers/power/regulator/regulator_common.c b/drivers/power/regulator/regulator_common.c index ce3d80670de..cf98998579a 100644 --- a/drivers/power/regulator/regulator_common.c +++ b/drivers/power/regulator/regulator_common.c @@ -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);