Commit dcbc0edd authored by Daniel Lezcano's avatar Daniel Lezcano

clocksource/drivers/smp_twd: Convert init function to return error

The init functions do not return any error. They behave as the following:

  - panic, thus leading to a kernel crash while another timer may work and
       make the system boot up correctly

  or

  - print an error and let the caller unaware if the state of the system

Change that by converting the init functions to return an error conforming
to the CLOCKSOURCE_OF_RET prototype.

Proper error handling (rollback, errno value) will be changed later case
by case, thus this change just return back an error or success in the init
function.
Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
parent dd1364a7
...@@ -390,7 +390,7 @@ int __init twd_local_timer_register(struct twd_local_timer *tlt) ...@@ -390,7 +390,7 @@ int __init twd_local_timer_register(struct twd_local_timer *tlt)
} }
#ifdef CONFIG_OF #ifdef CONFIG_OF
static void __init twd_local_timer_of_register(struct device_node *np) static int __init twd_local_timer_of_register(struct device_node *np)
{ {
int err; int err;
...@@ -410,8 +410,9 @@ static void __init twd_local_timer_of_register(struct device_node *np) ...@@ -410,8 +410,9 @@ static void __init twd_local_timer_of_register(struct device_node *np)
out: out:
WARN(err, "twd_local_timer_of_register failed (%d)\n", err); WARN(err, "twd_local_timer_of_register failed (%d)\n", err);
return err;
} }
CLOCKSOURCE_OF_DECLARE(arm_twd_a9, "arm,cortex-a9-twd-timer", twd_local_timer_of_register); CLOCKSOURCE_OF_DECLARE_RET(arm_twd_a9, "arm,cortex-a9-twd-timer", twd_local_timer_of_register);
CLOCKSOURCE_OF_DECLARE(arm_twd_a5, "arm,cortex-a5-twd-timer", twd_local_timer_of_register); CLOCKSOURCE_OF_DECLARE_RET(arm_twd_a5, "arm,cortex-a5-twd-timer", twd_local_timer_of_register);
CLOCKSOURCE_OF_DECLARE(arm_twd_11mp, "arm,arm11mp-twd-timer", twd_local_timer_of_register); CLOCKSOURCE_OF_DECLARE_RET(arm_twd_11mp, "arm,arm11mp-twd-timer", twd_local_timer_of_register);
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment