aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/clock34xx.c
diff options
context:
space:
mode:
authorSanjeev Premi <premi@ti.com>2010-02-24 14:05:56 -0500
committerPaul Walmsley <paul@pwsan.com>2010-02-24 14:05:56 -0500
commita51ba284076437ce36efc8dd9b15983546c043f7 (patch)
tree9548b92b4255cd28e9c1c7bec2d8af95c440d9e0 /arch/arm/mach-omap2/clock34xx.c
parent3cc4a2fc2ed7727828f410ab092111cb56cefd61 (diff)
OMAP3 clock: Check return values for clk_get()
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> Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch/arm/mach-omap2/clock34xx.c')
-rw-r--r--arch/arm/mach-omap2/clock34xx.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c
index 0e4fdba7f20..de7391b6bcf 100644
--- a/arch/arm/mach-omap2/clock34xx.c
+++ b/arch/arm/mach-omap2/clock34xx.c
@@ -21,6 +21,7 @@
21#include <linux/delay.h> 21#include <linux/delay.h>
22#include <linux/clk.h> 22#include <linux/clk.h>
23#include <linux/io.h> 23#include <linux/io.h>
24#include <linux/err.h>
24 25
25#include <plat/cpu.h> 26#include <plat/cpu.h>
26#include <plat/clock.h> 27#include <plat/clock.h>
@@ -286,6 +287,7 @@ static int __init omap3xxx_clk_arch_init(void)
286{ 287{
287 struct clk *osc_sys_ck, *dpll1_ck, *arm_fck, *core_ck; 288 struct clk *osc_sys_ck, *dpll1_ck, *arm_fck, *core_ck;
288 unsigned long osc_sys_rate; 289 unsigned long osc_sys_rate;
290 bool err = 0;
289 291
290 if (!cpu_is_omap34xx()) 292 if (!cpu_is_omap34xx())
291 return 0; 293 return 0;
@@ -295,9 +297,23 @@ static int __init omap3xxx_clk_arch_init(void)
295 297
296 /* XXX test these for success */ 298 /* XXX test these for success */
297 dpll1_ck = clk_get(NULL, "dpll1_ck"); 299 dpll1_ck = clk_get(NULL, "dpll1_ck");
300 if (WARN(IS_ERR(dpll1_ck), "Failed to get dpll1_ck.\n"))
301 err = 1;
302
298 arm_fck = clk_get(NULL, "arm_fck"); 303 arm_fck = clk_get(NULL, "arm_fck");
304 if (WARN(IS_ERR(arm_fck), "Failed to get arm_fck.\n"))
305 err = 1;
306
299 core_ck = clk_get(NULL, "core_ck"); 307 core_ck = clk_get(NULL, "core_ck");
308 if (WARN(IS_ERR(core_ck), "Failed to get core_ck.\n"))
309 err = 1;
310
300 osc_sys_ck = clk_get(NULL, "osc_sys_ck"); 311 osc_sys_ck = clk_get(NULL, "osc_sys_ck");
312 if (WARN(IS_ERR(osc_sys_ck), "Failed to get osc_sys_ck.\n"))
313 err = 1;
314
315 if (err)
316 return -ENOENT;
301 317
302 /* REVISIT: not yet ready for 343x */ 318 /* REVISIT: not yet ready for 343x */
303 if (clk_set_rate(dpll1_ck, mpurate)) 319 if (clk_set_rate(dpll1_ck, mpurate))