Skip to content

Commit 5dc63fd

Browse files
ArvindYadavCshtejun
authored andcommitted
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: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Tejun Heo <tj@kernel.org>
1 parent 8bfd174 commit 5dc63fd

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

drivers/ata/sata_rcar.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,10 @@ static int sata_rcar_probe(struct platform_device *pdev)
890890
dev_err(&pdev->dev, "failed to get access to sata clock\n");
891891
return PTR_ERR(priv->clk);
892892
}
893-
clk_prepare_enable(priv->clk);
893+
894+
ret = clk_prepare_enable(priv->clk);
895+
if (ret)
896+
return ret;
894897

895898
host = ata_host_alloc(&pdev->dev, 1);
896899
if (!host) {
@@ -970,8 +973,11 @@ static int sata_rcar_resume(struct device *dev)
970973
struct ata_host *host = dev_get_drvdata(dev);
971974
struct sata_rcar_priv *priv = host->private_data;
972975
void __iomem *base = priv->base;
976+
int ret;
973977

974-
clk_prepare_enable(priv->clk);
978+
ret = clk_prepare_enable(priv->clk);
979+
if (ret)
980+
return ret;
975981

976982
/* ack and mask */
977983
iowrite32(0, base + SATAINTSTAT_REG);
@@ -988,8 +994,11 @@ static int sata_rcar_restore(struct device *dev)
988994
{
989995
struct ata_host *host = dev_get_drvdata(dev);
990996
struct sata_rcar_priv *priv = host->private_data;
997+
int ret;
991998

992-
clk_prepare_enable(priv->clk);
999+
ret = clk_prepare_enable(priv->clk);
1000+
if (ret)
1001+
return ret;
9931002

9941003
sata_rcar_setup_port(host);
9951004

0 commit comments

Comments
 (0)