aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2016-08-30 17:47:35 -0400
committerRussell King <rmk+kernel@armlinux.org.uk>2016-09-20 09:21:07 -0400
commitdeee856a5c6293c50ad6589c9f8a1cca5ed08ae9 (patch)
tree80f8bce58e8738fb68f7cb1956767cc0f25a7e8a
parent7d53c1f01210aa79838f1fe34b2a89f8e900d720 (diff)
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>
-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)
700 if (!sachip) 700 if (!sachip)
701 return -ENOMEM; 701 return -ENOMEM;
702 702
703 sachip->clk = clk_get(me, "SA1111_CLK"); 703 sachip->clk = devm_clk_get(me, "SA1111_CLK");
704 if (IS_ERR(sachip->clk)) { 704 if (IS_ERR(sachip->clk))
705 ret = PTR_ERR(sachip->clk); 705 return PTR_ERR(sachip->clk);
706 goto err_free;
707 }
708 706
709 ret = clk_prepare(sachip->clk); 707 ret = clk_prepare(sachip->clk);
710 if (ret) 708 if (ret)
711 goto err_clkput; 709 return ret;
712 710
713 spin_lock_init(&sachip->lock); 711 spin_lock_init(&sachip->lock);
714 712
@@ -805,9 +803,6 @@ static int __sa1111_probe(struct device *me, struct resource *mem, int irq)
805 iounmap(sachip->base); 803 iounmap(sachip->base);
806 err_clk_unprep: 804 err_clk_unprep:
807 clk_unprepare(sachip->clk); 805 clk_unprepare(sachip->clk);
808 err_clkput:
809 clk_put(sachip->clk);
810 err_free:
811 return ret; 806 return ret;
812} 807}
813 808
@@ -845,7 +840,6 @@ static void __sa1111_remove(struct sa1111 *sachip)
845 } 840 }
846 841
847 iounmap(sachip->base); 842 iounmap(sachip->base);
848 clk_put(sachip->clk);
849} 843}
850 844
851struct sa1111_save_data { 845struct sa1111_save_data {