@@ -1582,8 +1582,11 @@ static int viu_of_probe(struct platform_device *op)
dev_err(&op->dev, "failed to find the clock module!\n");
ret = -ENODEV;
goto err_clk;
- } else {
- clk_enable(viu_dev->clk);
+ }
+ ret = clk_prepare_enable(viu_dev->clk);
+ if (ret) {
+ dev_err(&op->dev, "failed to enable the clock!\n");
+ goto err_clk_put;
}
/* reset VIU module */
@@ -1602,7 +1605,8 @@ static int viu_of_probe(struct platform_device *op)
return ret;
err_irq:
- clk_disable(viu_dev->clk);
+ clk_disable_unprepare(viu_dev->clk);
+err_clk_put:
clk_put(viu_dev->clk);
err_clk:
video_unregister_device(viu_dev->vdev);
@@ -1626,7 +1630,7 @@ static int viu_of_remove(struct platform_device *op)
free_irq(dev->irq, (void *)dev);
irq_dispose_mapping(dev->irq);
- clk_disable(dev->clk);
+ clk_disable_unprepare(dev->clk);
clk_put(dev->clk);
video_unregister_device(dev->vdev);
device tree based clock lookup, must prepare clocks before enabling them, unprepare after disable, error check in the clock setup Signed-off-by: Gerhard Sittig <gsi@denx.de> --- drivers/media/platform/fsl-viu.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)