clk: timer-sp: convert to clk_prepare()/clk_unprepare()
authorRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 22 Sep 2011 10:38:40 +0000 (11:38 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 27 Sep 2011 08:25:53 +0000 (09:25 +0100)
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/common/timer-sp.c

index 41df47875122a6fcd641a3c47df9ce1de696ce30..2393b5bc96fa12845846bffe613a01c61db176b2 100644 (file)
@@ -41,9 +41,17 @@ static long __init sp804_get_clock_rate(const char *name)
                return PTR_ERR(clk);
        }
 
+       err = clk_prepare(clk);
+       if (err) {
+               pr_err("sp804: %s clock failed to prepare: %d\n", name, err);
+               clk_put(clk);
+               return err;
+       }
+
        err = clk_enable(clk);
        if (err) {
                pr_err("sp804: %s clock failed to enable: %d\n", name, err);
+               clk_unprepare(clk);
                clk_put(clk);
                return err;
        }
@@ -52,6 +60,7 @@ static long __init sp804_get_clock_rate(const char *name)
        if (rate < 0) {
                pr_err("sp804: %s clock failed to get rate: %ld\n", name, rate);
                clk_disable(clk);
+               clk_unprepare(clk);
                clk_put(clk);
        }