diff options
author | Fabio Estevam <fabio.estevam@freescale.com> | 2014-01-26 01:46:23 +0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2014-01-29 22:15:11 +0400 |
commit | 0475c947d221f9250bbdf430b2604f828b643ee0 (patch) | |
tree | bf215ae64752ed8a463dd280134c8567c7c5b881 /drivers/ata/pata_imx.c | |
parent | 0e47c969c65e213421450c31043353ebe3c67e0c (diff) | |
download | linux-0475c947d221f9250bbdf430b2604f828b643ee0.tar.xz |
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>
Diffstat (limited to 'drivers/ata/pata_imx.c')
-rw-r--r-- | drivers/ata/pata_imx.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/ata/pata_imx.c b/drivers/ata/pata_imx.c index 26386f0b89a8..b0b18ec5465f 100644 --- a/drivers/ata/pata_imx.c +++ b/drivers/ata/pata_imx.c @@ -119,7 +119,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) { @@ -212,7 +214,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); |