Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

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>
Signed-off-by: Tejun Heo <tj@kernel.org>

authored by

Fabio Estevam and committed by
Tejun Heo
0475c947 0e47c969

+6 -2
+6 -2
drivers/ata/pata_imx.c
··· 119 119 return PTR_ERR(priv->clk); 120 120 } 121 121 122 - clk_prepare_enable(priv->clk); 122 + ret = clk_prepare_enable(priv->clk); 123 + if (ret) 124 + return ret; 123 125 124 126 host = ata_host_alloc(&pdev->dev, 1); 125 127 if (!host) { ··· 214 212 struct ata_host *host = dev_get_drvdata(dev); 215 213 struct pata_imx_priv *priv = host->private_data; 216 214 217 - clk_prepare_enable(priv->clk); 215 + int ret = clk_prepare_enable(priv->clk); 216 + if (ret) 217 + return ret; 218 218 219 219 __raw_writel(priv->ata_ctl, priv->host_regs + PATA_IMX_ATA_CONTROL); 220 220