Skip to content

Commit 77ed247

Browse files
Jiasheng Jiangmchehab
authored andcommitted
media: camif-core: Add check for clk_enable()
Add check for the return value of clk_enable() to gurantee the success. Fixes: babde1c ("[media] V4L: Add driver for S3C24XX/S3C64XX SoC series camera interface") Signed-off-by: Jiasheng Jiang <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 125ad1a commit 77ed247

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

drivers/media/platform/samsung/s3c-camif/camif-core.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -527,10 +527,19 @@ static void s3c_camif_remove(struct platform_device *pdev)
527527
static int s3c_camif_runtime_resume(struct device *dev)
528528
{
529529
struct camif_dev *camif = dev_get_drvdata(dev);
530+
int ret;
531+
532+
ret = clk_enable(camif->clock[CLK_GATE]);
533+
if (ret)
534+
return ret;
530535

531-
clk_enable(camif->clock[CLK_GATE]);
532536
/* null op on s3c244x */
533-
clk_enable(camif->clock[CLK_CAM]);
537+
ret = clk_enable(camif->clock[CLK_CAM]);
538+
if (ret) {
539+
clk_disable(camif->clock[CLK_GATE]);
540+
return ret;
541+
}
542+
534543
return 0;
535544
}
536545

0 commit comments

Comments
 (0)