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>
This commit is contained in:
Fabio Estevam 2014-01-25 19:46:23 -02:00 committed by Tejun Heo
parent 0e47c969c6
commit 0475c947d2
1 changed files with 6 additions and 2 deletions

View File

@ -119,7 +119,9 @@ static int pata_imx_probe(struct platform_device *pdev)
return PTR_ERR(priv->clk); 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); host = ata_host_alloc(&pdev->dev, 1);
if (!host) { if (!host) {
@ -212,7 +214,9 @@ static int pata_imx_resume(struct device *dev)
struct ata_host *host = dev_get_drvdata(dev); struct ata_host *host = dev_get_drvdata(dev);
struct pata_imx_priv *priv = host->private_data; 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); __raw_writel(priv->ata_ctl, priv->host_regs + PATA_IMX_ATA_CONTROL);