summaryrefslogtreecommitdiff
path: root/arch/arm/mach-omap1/time.c
diff options
context:
space:
mode:
authorVaibhav Hiremath <hvaibhav@ti.com>2012-05-09 21:07:05 +0400
committerTony Lindgren <tony@atomide.com>2012-05-09 21:07:05 +0400
commit187999119d93f584209400b052cf092141a33650 (patch)
tree8c1c90df099ef080a5913ca62b45bf65d97dc0c9 /arch/arm/mach-omap1/time.c
parentbfd17879866b36e95c58721da070d9f2ac7f8901 (diff)
downloadlinux-187999119d93f584209400b052cf092141a33650.tar.xz
ARM: OMAP1: Add checks for possible error condition in timer_init
On OMAP1, omap_32k_timer_init() function always returns "true", irrespective of whether error occurred while initializing 32k sync counter as a kernel clocksource or not and execution will never fallback to mpu_timer clocksource init code. This patch adds check for return value from function omap_init_clocksource_32k(), and fallback to omap_mpu_timer_init() in case of failure/error from omap_init_clocksource_32k(). Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com> Acked-by: Kevin Hilman <khilman@ti.com> Tested-by: Kevin Hilman <khilman@ti.com> Cc: Paul Walmsley <paul@pwsan.com> Cc: Benoit Cousson <b-cousson@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap1/time.c')
-rw-r--r--arch/arm/mach-omap1/time.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/arch/arm/mach-omap1/time.c b/arch/arm/mach-omap1/time.c
index 4d8dd9a1b04c..4062480bfec7 100644
--- a/arch/arm/mach-omap1/time.c
+++ b/arch/arm/mach-omap1/time.c
@@ -232,20 +232,6 @@ static inline void omap_mpu_timer_init(void)
}
#endif /* CONFIG_OMAP_MPU_TIMER */
-static inline int omap_32k_timer_usable(void)
-{
- int res = false;
-
- if (cpu_is_omap730() || cpu_is_omap15xx())
- return res;
-
-#ifdef CONFIG_OMAP_32K_TIMER
- res = omap_32k_timer_init();
-#endif
-
- return res;
-}
-
/*
* ---------------------------------------------------------------------------
* Timer initialization
@@ -253,7 +239,7 @@ static inline int omap_32k_timer_usable(void)
*/
static void __init omap1_timer_init(void)
{
- if (!omap_32k_timer_usable())
+ if (omap_32k_timer_init() != 0)
omap_mpu_timer_init();
}