Commit e8d891fb authored by Felipe Balbi's avatar Felipe Balbi

usb: phy: gpio-vbus: don't ignore regulator APIs return value

Due to recent changes to regulator API, all
users which don't check regulator_{en,dis}able()'s
return value will generate compile warnings.

Add such checks to gpio-vbus.

Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent b64a1593
...@@ -61,6 +61,7 @@ static void set_vbus_draw(struct gpio_vbus_data *gpio_vbus, unsigned mA) ...@@ -61,6 +61,7 @@ static void set_vbus_draw(struct gpio_vbus_data *gpio_vbus, unsigned mA)
{ {
struct regulator *vbus_draw = gpio_vbus->vbus_draw; struct regulator *vbus_draw = gpio_vbus->vbus_draw;
int enabled; int enabled;
int ret;
if (!vbus_draw) if (!vbus_draw)
return; return;
...@@ -69,12 +70,16 @@ static void set_vbus_draw(struct gpio_vbus_data *gpio_vbus, unsigned mA) ...@@ -69,12 +70,16 @@ static void set_vbus_draw(struct gpio_vbus_data *gpio_vbus, unsigned mA)
if (mA) { if (mA) {
regulator_set_current_limit(vbus_draw, 0, 1000 * mA); regulator_set_current_limit(vbus_draw, 0, 1000 * mA);
if (!enabled) { if (!enabled) {
regulator_enable(vbus_draw); ret = regulator_enable(vbus_draw);
if (ret < 0)
return;
gpio_vbus->vbus_draw_enabled = 1; gpio_vbus->vbus_draw_enabled = 1;
} }
} else { } else {
if (enabled) { if (enabled) {
regulator_disable(vbus_draw); ret = regulator_disable(vbus_draw);
if (ret < 0)
return;
gpio_vbus->vbus_draw_enabled = 0; gpio_vbus->vbus_draw_enabled = 0;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment