public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCHv2] omap3: Check return values for clk_get()
@ 2010-01-28 15:16 Sanjeev Premi
  2010-01-28 19:08 ` Kevin Hilman
  2010-02-05 20:24 ` Paul Walmsley
  0 siblings, 2 replies; 3+ messages in thread
From: Sanjeev Premi @ 2010-01-28 15:16 UTC (permalink / raw)
  To: linux-omap; +Cc: Sanjeev Premi

This patch checks if clk_get() returned success for
the clocks used in function omap2_clk_arch_init().

This version incorporates review comments from
Kevin Hilman and Paul Walmsley.

Signed-off-by: Sanjeev Premi <premi@ti.com>
---
 arch/arm/mach-omap2/clock34xx.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c
index 1f1b5a6..ad09f04 100644
--- a/arch/arm/mach-omap2/clock34xx.c
+++ b/arch/arm/mach-omap2/clock34xx.c
@@ -21,6 +21,7 @@
 #include <linux/delay.h>
 #include <linux/clk.h>
 #include <linux/io.h>
+#include <linux/err.h>
 
 #include <plat/cpu.h>
 #include <plat/clock.h>
@@ -184,6 +185,7 @@ static int __init omap3xxx_clk_arch_init(void)
 {
 	struct clk *osc_sys_ck, *dpll1_ck, *arm_fck, *core_ck;
 	unsigned long osc_sys_rate;
+	bool err = 0 ;
 
 	if (!cpu_is_omap34xx())
 		return 0;
@@ -193,9 +195,23 @@ static int __init omap3xxx_clk_arch_init(void)
 
 	/* XXX test these for success */
 	dpll1_ck = clk_get(NULL, "dpll1_ck");
+	if (WARN(IS_ERR(dpll1_ck), "Failed to get dpll1_ck.\n"))
+		err = 1;
+
 	arm_fck = clk_get(NULL, "arm_fck");
+	if (WARN(IS_ERR(arm_fck), "Failed to get arm_fck.\n"))
+		err = 1;
+
 	core_ck = clk_get(NULL, "core_ck");
+	if (WARN(IS_ERR(core_ck), "Failed to get core_ck.\n"))
+		err = 1;
+
 	osc_sys_ck = clk_get(NULL, "osc_sys_ck");
+	if (WARN(IS_ERR(osc_sys_ck), "Failed to get osc_sys_ck.\n"))
+		err = 1;
+
+	if (err)
+		return -ENOENT;
 
 	/* REVISIT: not yet ready for 343x */
 	if (clk_set_rate(dpll1_ck, mpurate))
-- 
1.6.2.2


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

* Re: [PATCHv2] omap3: Check return values for clk_get()
  2010-01-28 15:16 [PATCHv2] omap3: Check return values for clk_get() Sanjeev Premi
@ 2010-01-28 19:08 ` Kevin Hilman
  2010-02-05 20:24 ` Paul Walmsley
  1 sibling, 0 replies; 3+ messages in thread
From: Kevin Hilman @ 2010-01-28 19:08 UTC (permalink / raw)
  To: Sanjeev Premi; +Cc: linux-omap

Sanjeev Premi <premi@ti.com> writes:

> This patch checks if clk_get() returned success for
> the clocks used in function omap2_clk_arch_init().
>
> This version incorporates review comments from
> Kevin Hilman and Paul Walmsley.
>
> Signed-off-by: Sanjeev Premi <premi@ti.com>

Acked-by: Kevin Hilman <khilman@deeprootsystems.com>

> ---
>  arch/arm/mach-omap2/clock34xx.c |   16 ++++++++++++++++
>  1 files changed, 16 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c
> index 1f1b5a6..ad09f04 100644
> --- a/arch/arm/mach-omap2/clock34xx.c
> +++ b/arch/arm/mach-omap2/clock34xx.c
> @@ -21,6 +21,7 @@
>  #include <linux/delay.h>
>  #include <linux/clk.h>
>  #include <linux/io.h>
> +#include <linux/err.h>
>  
>  #include <plat/cpu.h>
>  #include <plat/clock.h>
> @@ -184,6 +185,7 @@ static int __init omap3xxx_clk_arch_init(void)
>  {
>  	struct clk *osc_sys_ck, *dpll1_ck, *arm_fck, *core_ck;
>  	unsigned long osc_sys_rate;
> +	bool err = 0 ;
>  
>  	if (!cpu_is_omap34xx())
>  		return 0;
> @@ -193,9 +195,23 @@ static int __init omap3xxx_clk_arch_init(void)
>  
>  	/* XXX test these for success */
>  	dpll1_ck = clk_get(NULL, "dpll1_ck");
> +	if (WARN(IS_ERR(dpll1_ck), "Failed to get dpll1_ck.\n"))
> +		err = 1;
> +
>  	arm_fck = clk_get(NULL, "arm_fck");
> +	if (WARN(IS_ERR(arm_fck), "Failed to get arm_fck.\n"))
> +		err = 1;
> +
>  	core_ck = clk_get(NULL, "core_ck");
> +	if (WARN(IS_ERR(core_ck), "Failed to get core_ck.\n"))
> +		err = 1;
> +
>  	osc_sys_ck = clk_get(NULL, "osc_sys_ck");
> +	if (WARN(IS_ERR(osc_sys_ck), "Failed to get osc_sys_ck.\n"))
> +		err = 1;
> +
> +	if (err)
> +		return -ENOENT;
>  
>  	/* REVISIT: not yet ready for 343x */
>  	if (clk_set_rate(dpll1_ck, mpurate))
> -- 
> 1.6.2.2
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCHv2] omap3: Check return values for clk_get()
  2010-01-28 15:16 [PATCHv2] omap3: Check return values for clk_get() Sanjeev Premi
  2010-01-28 19:08 ` Kevin Hilman
@ 2010-02-05 20:24 ` Paul Walmsley
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Walmsley @ 2010-02-05 20:24 UTC (permalink / raw)
  To: Sanjeev Premi; +Cc: linux-omap

On Thu, 28 Jan 2010, Sanjeev Premi wrote:

> This patch checks if clk_get() returned success for
> the clocks used in function omap2_clk_arch_init().
> 
> This version incorporates review comments from
> Kevin Hilman and Paul Walmsley.
> 
> Signed-off-by: Sanjeev Premi <premi@ti.com>

Thanks, queued for 2.6.34 with one change:

> ---
>  arch/arm/mach-omap2/clock34xx.c |   16 ++++++++++++++++
>  1 files changed, 16 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c
> index 1f1b5a6..ad09f04 100644
> --- a/arch/arm/mach-omap2/clock34xx.c
> +++ b/arch/arm/mach-omap2/clock34xx.c
> @@ -184,6 +185,7 @@ static int __init omap3xxx_clk_arch_init(void)
>  {
>  	struct clk *osc_sys_ck, *dpll1_ck, *arm_fck, *core_ck;
>  	unsigned long osc_sys_rate;
> +	bool err = 0 ;

There should not be a space before the semicolon in the above line and so 
the space has been removed.

>  
>  	if (!cpu_is_omap34xx())
>  		return 0;

- Paul

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

end of thread, other threads:[~2010-02-05 20:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-28 15:16 [PATCHv2] omap3: Check return values for clk_get() Sanjeev Premi
2010-01-28 19:08 ` Kevin Hilman
2010-02-05 20:24 ` Paul Walmsley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox