linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] ARM: SMP_TWD: use clk_prepare_enable()
@ 2012-10-19  9:47 Linus Walleij
  2012-10-26  9:32 ` Ulf Hansson
  0 siblings, 1 reply; 2+ messages in thread
From: Linus Walleij @ 2012-10-19  9:47 UTC (permalink / raw)
  To: linux-arm-kernel

A minor code refactoring saving a few lines by merging prepare()
and enable() calls.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 arch/arm/kernel/smp_twd.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
index b22d700..b92d524 100644
--- a/arch/arm/kernel/smp_twd.c
+++ b/arch/arm/kernel/smp_twd.c
@@ -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);
 	}
-- 
1.7.11.7

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 2/2] ARM: SMP_TWD: use clk_prepare_enable()
  2012-10-19  9:47 [PATCH 2/2] ARM: SMP_TWD: use clk_prepare_enable() Linus Walleij
@ 2012-10-26  9:32 ` Ulf Hansson
  0 siblings, 0 replies; 2+ messages in thread
From: Ulf Hansson @ 2012-10-26  9:32 UTC (permalink / raw)
  To: linux-arm-kernel

On 19 October 2012 11:47, Linus Walleij <linus.walleij@linaro.org> wrote:
> A minor code refactoring saving a few lines by merging prepare()
> and enable() calls.
>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  arch/arm/kernel/smp_twd.c | 12 ++----------
>  1 file changed, 2 insertions(+), 10 deletions(-)
>
> diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
> index b22d700..b92d524 100644
> --- a/arch/arm/kernel/smp_twd.c
> +++ b/arch/arm/kernel/smp_twd.c
> @@ -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);
>         }
> --
> 1.7.11.7
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Looks nice!

Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-10-26  9:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-19  9:47 [PATCH 2/2] ARM: SMP_TWD: use clk_prepare_enable() Linus Walleij
2012-10-26  9:32 ` Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).