diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2013-04-04 05:25:04 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2013-04-11 19:37:38 -0400 |
commit | 50f5a3415c2fc494e2bd80fc9e80cc62d64cbc3c (patch) | |
tree | df52c427d493e3878dd0ab75ebce17fef92fee89 /drivers/ata | |
parent | 2de1d5e159ccf317a9285a0dfaa6e4262500d7dd (diff) |
pata_imx: Use devm_clk_get
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>
Diffstat (limited to 'drivers/ata')
-rw-r--r-- | drivers/ata/pata_imx.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/ata/pata_imx.c b/drivers/ata/pata_imx.c index 40849445a9dc..af893dda8528 100644 --- a/drivers/ata/pata_imx.c +++ b/drivers/ata/pata_imx.c | |||
@@ -112,7 +112,7 @@ static int pata_imx_probe(struct platform_device *pdev) | |||
112 | if (!priv) | 112 | if (!priv) |
113 | return -ENOMEM; | 113 | return -ENOMEM; |
114 | 114 | ||
115 | priv->clk = clk_get(&pdev->dev, NULL); | 115 | priv->clk = devm_clk_get(&pdev->dev, NULL); |
116 | if (IS_ERR(priv->clk)) { | 116 | if (IS_ERR(priv->clk)) { |
117 | dev_err(&pdev->dev, "Failed to get clock\n"); | 117 | dev_err(&pdev->dev, "Failed to get clock\n"); |
118 | return PTR_ERR(priv->clk); | 118 | return PTR_ERR(priv->clk); |
@@ -163,7 +163,7 @@ static int pata_imx_probe(struct platform_device *pdev) | |||
163 | 163 | ||
164 | free_priv: | 164 | free_priv: |
165 | clk_disable_unprepare(priv->clk); | 165 | clk_disable_unprepare(priv->clk); |
166 | clk_put(priv->clk); | 166 | |
167 | return -ENOMEM; | 167 | return -ENOMEM; |
168 | } | 168 | } |
169 | 169 | ||
@@ -177,7 +177,6 @@ static int pata_imx_remove(struct platform_device *pdev) | |||
177 | __raw_writel(0, priv->host_regs + PATA_IMX_ATA_INT_EN); | 177 | __raw_writel(0, priv->host_regs + PATA_IMX_ATA_INT_EN); |
178 | 178 | ||
179 | clk_disable_unprepare(priv->clk); | 179 | clk_disable_unprepare(priv->clk); |
180 | clk_put(priv->clk); | ||
181 | 180 | ||
182 | return 0; | 181 | return 0; |
183 | } | 182 | } |