media: i2c: ov5645: Refactor ov5645_set_power_off()
authorRicardo Ribalda <ribalda@chromium.org>
Fri, 16 Aug 2024 12:32:00 +0000 (12:32 +0000)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Sat, 31 Aug 2024 07:40:43 +0000 (09:40 +0200)
commit820d81a167d422027ca4af7f0511e101f21aa214
tree5968a42b58b7a2e8b1d2b40cf4b4483a5e4b40b1
parent2933d7e12ed792e12ab690efd15f6e7ce81ba739
media: i2c: ov5645: Refactor ov5645_set_power_off()

Factor out all the power off logic, except clk_disable_unprepare(), to a
new function __ov5645_set_power_off().

This allows ov5645_set_power_on() to excplicitly clean-out the clock
during the error-path.

The following smatch warning is fixed:
drivers/media/i2c/ov5645.c:690 ov5645_set_power_on() warn: 'ov5645->xclk' from clk_prepare_enable() not released on lines: 690.

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
drivers/media/i2c/ov5645.c