diff mbox series

[-next] media: ov7251: add missing disable functions on error in ov7251_set_power_on()

Message ID 20220620112042.3231519-1-yangyingliang@huawei.com (mailing list archive)
State New, archived
Headers show
Series [-next] media: ov7251: add missing disable functions on error in ov7251_set_power_on() | expand

Commit Message

Yang Yingliang June 20, 2022, 11:20 a.m. UTC
Add the missing gpiod_set_value_cansleep() and clk_disable_unprepare()
before return from ov7251_set_power_on() in the error handling case.

Fixes: 9e1d3012cc10 ("media: i2c: Remove .s_power() from ov7251")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/media/i2c/ov7251.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Andy Shevchenko June 21, 2022, 11:52 a.m. UTC | #1
On Mon, Jun 20, 2022 at 07:20:42PM +0800, Yang Yingliang wrote:
> Add the missing gpiod_set_value_cansleep() and clk_disable_unprepare()
> before return from ov7251_set_power_on() in the error handling case.

There is already a patch with the same version. If anything has been changed,
care about versioning and changelog.
diff mbox series

Patch

diff --git a/drivers/media/i2c/ov7251.c b/drivers/media/i2c/ov7251.c
index 0e7be15bc20a..ad9689820ecc 100644
--- a/drivers/media/i2c/ov7251.c
+++ b/drivers/media/i2c/ov7251.c
@@ -934,6 +934,8 @@  static int ov7251_set_power_on(struct device *dev)
 					ARRAY_SIZE(ov7251_global_init_setting));
 	if (ret < 0) {
 		dev_err(ov7251->dev, "error during global init\n");
+		gpiod_set_value_cansleep(ov7251->enable_gpio, 0);
+		clk_disable_unprepare(ov7251->xclk);
 		ov7251_regulators_disable(ov7251);
 		return ret;
 	}