clocksource/drivers/clksrc-probe: Introduce init functions with return code

Currently, the clksrc-probe is not able to handle any error from the init
functions. There are different issues with the current code:
 - the code is duplicated in the init functions by writing error
 - every driver tends to panic in its own init function
 - counting the number of clocksources is not reliable

This patch adds another table to store the functions returning an error.
The table is temporary while we convert all the drivers to return an error
and will disappear.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
This commit is contained in:
Daniel Lezcano 2016-05-31 16:25:59 +02:00
parent c35d9292fe
commit b7c4db8616
3 changed files with 27 additions and 0 deletions

View file

@ -246,6 +246,9 @@ extern int clocksource_i8253_init(void);
#define CLOCKSOURCE_OF_DECLARE(name, compat, fn) \
OF_DECLARE_1(clksrc, name, compat, fn)
#define CLOCKSOURCE_OF_DECLARE_RET(name, compat, fn) \
OF_DECLARE_1_RET(clksrc_ret, name, compat, fn)
#ifdef CONFIG_CLKSRC_PROBE
extern void clocksource_probe(void);
#else