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>
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);