diff mbox

[3/3] pata_imx: Check the return value from clk_prepare_enable()

Message ID 1392468635-13373-3-git-send-email-festevam@gmail.com
State Not Applicable
Delegated to: David Miller
Headers show

Commit Message

Fabio Estevam Feb. 15, 2014, 12:50 p.m. UTC
From: Fabio Estevam <fabio.estevam@freescale.com>

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>
---
 drivers/ata/pata_imx.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/drivers/ata/pata_imx.c b/drivers/ata/pata_imx.c
index 1af71b7..7b669f6 100644
--- a/drivers/ata/pata_imx.c
+++ b/drivers/ata/pata_imx.c
@@ -114,7 +114,9 @@  static int pata_imx_probe(struct platform_device *pdev)
 		return PTR_ERR(priv->clk);
 	}
 
-	clk_prepare_enable(priv->clk);
+	ret = clk_prepare_enable(priv->clk);
+	if (ret)
+		return ret;
 
 	host = ata_host_alloc(&pdev->dev, 1);
 	if (!host) {