mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-05-05 04:36:13 +02:00
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 <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>
This commit is contained in:
parent
7dbec4f77c
commit
0411cac161
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user