diff options
author | Martin Kepplinger <martin.kepplinger@puri.sm> | 2021-11-09 14:10:12 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2021-12-16 20:54:53 +0100 |
commit | e1cc0a05539a115690e5d327dd1b40c15a59e19f (patch) | |
tree | 99faa6cfefddd480347bd978e93ef7044a9a75f1 /drivers | |
parent | d1d2ed5925c370ac09fa6efd39f5f569f562e5b7 (diff) |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/i2c/hi846.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/media/i2c/hi846.c b/drivers/media/i2c/hi846.c index 48909faeced4..47fa0324f7fb 100644 --- a/drivers/media/i2c/hi846.c +++ b/drivers/media/i2c/hi846.c @@ -1656,7 +1656,7 @@ err_reg: 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); @@ -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) @@ -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) |