ARM: 7561/1: SMP_TWD: use clk_prepare_enable()
authorLinus Walleij <linus.walleij@linaro.org>
Mon, 22 Oct 2012 09:18:06 +0000 (10:18 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sun, 4 Nov 2012 10:31:01 +0000 (10:31 +0000)
A minor code refactoring saving a few lines by merging prepare()
and enable() calls.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/kernel/smp_twd.c

index e1f9069..780b057 100644 (file)
@@ -248,17 +248,9 @@ static struct clk *twd_get_clock(void)
                return clk;
        }
 
-       err = clk_prepare(clk);
+       err = clk_prepare_enable(clk);
        if (err) {
-               pr_err("smp_twd: clock failed to prepare: %d\n", err);
-               clk_put(clk);
-               return ERR_PTR(err);
-       }
-
-       err = clk_enable(clk);
-       if (err) {
-               pr_err("smp_twd: clock failed to enable: %d\n", err);
-               clk_unprepare(clk);
+               pr_err("smp_twd: clock failed to prepare+enable: %d\n", err);
                clk_put(clk);
                return ERR_PTR(err);
        }