summaryrefslogtreecommitdiff
path: root/arch/arm/common
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2016-08-31 00:47:35 +0300
committerRussell King <rmk+kernel@armlinux.org.uk>2016-09-20 16:21:07 +0300
commitdeee856a5c6293c50ad6589c9f8a1cca5ed08ae9 (patch)
tree80f8bce58e8738fb68f7cb1956767cc0f25a7e8a /arch/arm/common
parent7d53c1f01210aa79838f1fe34b2a89f8e900d720 (diff)
downloadlinux-deee856a5c6293c50ad6589c9f8a1cca5ed08ae9.tar.xz
ARM: sa1111: use devm_clk_get()
Convert sa1111 to use devm_clk_get() to get its clock resource, and strip out the clk_put() calls. This simplifies the error handling a little. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Diffstat (limited to 'arch/arm/common')
-rw-r--r--arch/arm/common/sa1111.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c
index f2ce21c03646..09a4f932c2ec 100644
--- a/arch/arm/common/sa1111.c
+++ b/arch/arm/common/sa1111.c
@@ -700,15 +700,13 @@ static int __sa1111_probe(struct device *me, struct resource *mem, int irq)
if (!sachip)
return -ENOMEM;
- sachip->clk = clk_get(me, "SA1111_CLK");
- if (IS_ERR(sachip->clk)) {
- ret = PTR_ERR(sachip->clk);
- goto err_free;
- }
+ sachip->clk = devm_clk_get(me, "SA1111_CLK");
+ if (IS_ERR(sachip->clk))
+ return PTR_ERR(sachip->clk);
ret = clk_prepare(sachip->clk);
if (ret)
- goto err_clkput;
+ return ret;
spin_lock_init(&sachip->lock);
@@ -805,9 +803,6 @@ static int __sa1111_probe(struct device *me, struct resource *mem, int irq)
iounmap(sachip->base);
err_clk_unprep:
clk_unprepare(sachip->clk);
- err_clkput:
- clk_put(sachip->clk);
- err_free:
return ret;
}
@@ -845,7 +840,6 @@ static void __sa1111_remove(struct sa1111 *sachip)
}
iounmap(sachip->base);
- clk_put(sachip->clk);
}
struct sa1111_save_data {