Skip to content

Commit

Permalink
pata_imx: Use devm_clk_get
Browse files Browse the repository at this point in the history
To make the error path a bit simpler.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
  • Loading branch information
Sascha Hauer authored and Jeff Garzik committed Apr 11, 2013
1 parent 2de1d5e commit 50f5a34
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/ata/pata_imx.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ static int pata_imx_probe(struct platform_device *pdev)
if (!priv)
return -ENOMEM;

priv->clk = clk_get(&pdev->dev, NULL);
priv->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(priv->clk)) {
dev_err(&pdev->dev, "Failed to get clock\n");
return PTR_ERR(priv->clk);
Expand Down Expand Up @@ -163,7 +163,7 @@ static int pata_imx_probe(struct platform_device *pdev)

free_priv:
clk_disable_unprepare(priv->clk);
clk_put(priv->clk);

return -ENOMEM;
}

Expand All @@ -177,7 +177,6 @@ static int pata_imx_remove(struct platform_device *pdev)
__raw_writel(0, priv->host_regs + PATA_IMX_ATA_INT_EN);

clk_disable_unprepare(priv->clk);
clk_put(priv->clk);

return 0;
}
Expand Down

0 comments on commit 50f5a34

Please sign in to comment.