Commit 5dc63fdc authored by Arvind Yadav's avatar Arvind Yadav Committed by Tejun Heo

ata: sata_rcar: Handle return value of clk_prepare_enable

Here, Clock enable can failed. So adding an error check for
clk_prepare_enable.

tj: minor style updates
Signed-off-by: default avatarArvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent 8bfd1743
...@@ -890,7 +890,10 @@ static int sata_rcar_probe(struct platform_device *pdev) ...@@ -890,7 +890,10 @@ static int sata_rcar_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "failed to get access to sata clock\n"); dev_err(&pdev->dev, "failed to get access to sata clock\n");
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) {
...@@ -970,8 +973,11 @@ static int sata_rcar_resume(struct device *dev) ...@@ -970,8 +973,11 @@ static int sata_rcar_resume(struct device *dev)
struct ata_host *host = dev_get_drvdata(dev); struct ata_host *host = dev_get_drvdata(dev);
struct sata_rcar_priv *priv = host->private_data; struct sata_rcar_priv *priv = host->private_data;
void __iomem *base = priv->base; void __iomem *base = priv->base;
int ret;
clk_prepare_enable(priv->clk); ret = clk_prepare_enable(priv->clk);
if (ret)
return ret;
/* ack and mask */ /* ack and mask */
iowrite32(0, base + SATAINTSTAT_REG); iowrite32(0, base + SATAINTSTAT_REG);
...@@ -988,8 +994,11 @@ static int sata_rcar_restore(struct device *dev) ...@@ -988,8 +994,11 @@ static int sata_rcar_restore(struct device *dev)
{ {
struct ata_host *host = dev_get_drvdata(dev); struct ata_host *host = dev_get_drvdata(dev);
struct sata_rcar_priv *priv = host->private_data; struct sata_rcar_priv *priv = host->private_data;
int ret;
clk_prepare_enable(priv->clk); ret = clk_prepare_enable(priv->clk);
if (ret)
return ret;
sata_rcar_setup_port(host); sata_rcar_setup_port(host);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment