Skip to contentSkip to conversation

ata: pata_imx: Check the return value from clk_prepare_enable()

PATCH Applied Fabio Estevam 2 participants 2 messages Jan 25, 2014 – Jan 29, 2014

Subsystems (2)
lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH 1/1 ata: pata_imx: Check the return value from clk_prepare_enable()

From: Fabio Estevam <[email protected]>

clk_prepare_enable() may fail, so let's check its return value and propagate it in the case of error.

---
 drivers/ata/pata_imx.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/ata/pata_imx.c +6 -2
index 97417d5..7e69797 100644
@@ -118,7 +118,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) {
@@ -211,7 +213,9 @@ static int pata_imx_resume(struct device *dev)
 	struct ata_host *host = dev_get_drvdata(dev);
 	struct pata_imx_priv *priv = host->private_data;
 
-	clk_prepare_enable(priv->clk);
+	int ret = clk_prepare_enable(priv->clk);
+	if (ret)
+		return ret;
 
 	__raw_writel(priv->ata_ctl, priv->host_regs + PATA_IMX_ATA_CONTROL);
 
Signature · 1 line
1.8.1.2