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: Felipe Balbi <balbi@ti.com>
{
struct regulator *vbus_draw = gpio_vbus->vbus_draw;
int enabled;
+ int ret;
if (!vbus_draw)
return;
if (mA) {
regulator_set_current_limit(vbus_draw, 0, 1000 * mA);
if (!enabled) {
- regulator_enable(vbus_draw);
+ ret = regulator_enable(vbus_draw);
+ if (ret < 0)
+ return;
gpio_vbus->vbus_draw_enabled = 1;
}
} else {
if (enabled) {
- regulator_disable(vbus_draw);
+ ret = regulator_disable(vbus_draw);
+ if (ret < 0)
+ return;
gpio_vbus->vbus_draw_enabled = 0;
}
}