imx-drm: ipu-common: Check the return value from clk_prepare_enable()
authorFabio Estevam <fabio.estevam@freescale.com>
Sat, 20 Jul 2013 21:22:10 +0000 (18:22 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jul 2013 20:35:49 +0000 (13:35 -0700)
clk_prepare_enable() may fail, so let's check its return value and propagate it
in the case of error.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/imx-drm/ipu-v3/ipu-common.c

index d06b0c81f3972b4da7547bcd2a84cc6efdd0bf51..f1299da5ec2010b133ddde34e2cac8685877228d 100644 (file)
@@ -1087,7 +1087,11 @@ static int ipu_probe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, ipu);
 
-       clk_prepare_enable(ipu->clk);
+       ret = clk_prepare_enable(ipu->clk);
+       if (ret) {
+               dev_err(&pdev->dev, "clk_prepare_enable failed: %d\n", ret);
+               return ret;
+       }
 
        ipu->dev = &pdev->dev;
        ipu->irq_sync = irq_sync;