Hi,
On 1/13/2026 3:05 PM, Neil Armstrong wrote:
On 1/8/26 15:42, Julien Stephan wrote:
Use dm_gpio_is_valid() helper function instead of manually checking the
gpio.
Reviewed-by: Peng Fan <[email protected]>
Signed-off-by: Julien Stephan <[email protected]>
---
drivers/power/regulator/regulator_common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/power/regulator/regulator_common.c b/drivers/
power/regulator/regulator_common.c
index
ce3d80670de045dde7e263c5301bccd744abd2f5..cf98998579aa8a3cb7f09dccd2124207a58d8b00 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);
Reviewed-by: Neil Armstrong <[email protected]>
Reviewed-by: Tanmay Kathpalia <[email protected]>
Regards,
Tanmay