media: ov7251: add missing disable functions on error in ov7251_set_power_on()

[ Upstream commit 7a9795b31049b7e233d050a82b00094155a695c7 ]

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>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Yang Yingliang 2022-06-22 05:42:43 +01:00 committed by Greg Kroah-Hartman
parent 09dca68965
commit 3614c1981f

View File

@ -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;
}