media: camif-core: Add check for clk_enable()

Add check for the return value of clk_enable() to gurantee the success.

Fixes: babde1c243 ("[media] V4L: Add driver for S3C24XX/S3C64XX SoC series camera interface")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
Jiasheng Jiang
2024-11-25 19:18:17 +00:00
committed by Mauro Carvalho Chehab
parent 125ad1aeec
commit 77ed2470ac
@@ -527,10 +527,19 @@ static void s3c_camif_remove(struct platform_device *pdev)
static int s3c_camif_runtime_resume(struct device *dev)
{
struct camif_dev *camif = dev_get_drvdata(dev);
int ret;
ret = clk_enable(camif->clock[CLK_GATE]);
if (ret)
return ret;
clk_enable(camif->clock[CLK_GATE]);
/* null op on s3c244x */
clk_enable(camif->clock[CLK_CAM]);
ret = clk_enable(camif->clock[CLK_CAM]);
if (ret) {
clk_disable(camif->clock[CLK_GATE]);
return ret;
}
return 0;
}