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>
This commit is contained in:

committed by
Tony Lindgren

parent
bfd1787986
commit
187999119d
@@ -182,10 +182,15 @@ static __init void omap_init_32k_timer(void)
|
||||
* Timer initialization
|
||||
* ---------------------------------------------------------------------------
|
||||
*/
|
||||
bool __init omap_32k_timer_init(void)
|
||||
int __init omap_32k_timer_init(void)
|
||||
{
|
||||
omap_init_clocksource_32k();
|
||||
omap_init_32k_timer();
|
||||
int ret = -ENODEV;
|
||||
|
||||
return true;
|
||||
if (cpu_is_omap16xx())
|
||||
ret = omap_init_clocksource_32k();
|
||||
|
||||
if (!ret)
|
||||
omap_init_32k_timer();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user