Skip to content

Commit

Permalink
media: i2c: hi846: check return value of regulator_bulk_disable()
Browse files Browse the repository at this point in the history
regulator_bulk_disable can fail and thus suspend() can. Handle that error
gracefully.

Signed-off-by: Martin Kepplinger <[email protected]>
Signed-off-by: Sakari Ailus <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
merge authored and mchehab committed Dec 16, 2021
1 parent d1d2ed5 commit e1cc0a0
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions drivers/media/i2c/hi846.c
Original file line number Diff line number Diff line change
Expand Up @@ -1656,7 +1656,7 @@ static int hi846_power_on(struct hi846 *hi846)
return ret;
}

static void hi846_power_off(struct hi846 *hi846)
static int hi846_power_off(struct hi846 *hi846)
{
if (hi846->rst_gpio)
gpiod_set_value_cansleep(hi846->rst_gpio, 1);
Expand All @@ -1665,7 +1665,7 @@ static void hi846_power_off(struct hi846 *hi846)
gpiod_set_value_cansleep(hi846->shutdown_gpio, 1);

clk_disable_unprepare(hi846->clock);
regulator_bulk_disable(HI846_NUM_SUPPLIES, hi846->supplies);
return regulator_bulk_disable(HI846_NUM_SUPPLIES, hi846->supplies);
}

static int __maybe_unused hi846_suspend(struct device *dev)
Expand All @@ -1677,9 +1677,7 @@ static int __maybe_unused hi846_suspend(struct device *dev)
if (hi846->streaming)
hi846_stop_streaming(hi846);

hi846_power_off(hi846);

return 0;
return hi846_power_off(hi846);
}

static int __maybe_unused hi846_resume(struct device *dev)
Expand Down

0 comments on commit e1cc0a0

Please sign in to comment.