Skip to content

Commit e1cc0a0

Browse files
mergemchehab
authored andcommitted
media: i2c: hi846: check return value of regulator_bulk_disable()
regulator_bulk_disable can fail and thus suspend() can. Handle that error gracefully. Signed-off-by: Martin Kepplinger <martin.kepplinger@puri.sm> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
1 parent d1d2ed5 commit e1cc0a0

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

drivers/media/i2c/hi846.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1656,7 +1656,7 @@ static int hi846_power_on(struct hi846 *hi846)
16561656
return ret;
16571657
}
16581658

1659-
static void hi846_power_off(struct hi846 *hi846)
1659+
static int hi846_power_off(struct hi846 *hi846)
16601660
{
16611661
if (hi846->rst_gpio)
16621662
gpiod_set_value_cansleep(hi846->rst_gpio, 1);
@@ -1665,7 +1665,7 @@ static void hi846_power_off(struct hi846 *hi846)
16651665
gpiod_set_value_cansleep(hi846->shutdown_gpio, 1);
16661666

16671667
clk_disable_unprepare(hi846->clock);
1668-
regulator_bulk_disable(HI846_NUM_SUPPLIES, hi846->supplies);
1668+
return regulator_bulk_disable(HI846_NUM_SUPPLIES, hi846->supplies);
16691669
}
16701670

16711671
static int __maybe_unused hi846_suspend(struct device *dev)
@@ -1677,9 +1677,7 @@ static int __maybe_unused hi846_suspend(struct device *dev)
16771677
if (hi846->streaming)
16781678
hi846_stop_streaming(hi846);
16791679

1680-
hi846_power_off(hi846);
1681-
1682-
return 0;
1680+
return hi846_power_off(hi846);
16831681
}
16841682

16851683
static int __maybe_unused hi846_resume(struct device *dev)

0 commit comments

Comments
 (0)