From b7c4db861683af5fc50ac3cb3751cf847d765211 Mon Sep 17 00:00:00 2001 From: Daniel Lezcano Date: Tue, 31 May 2016 16:25:59 +0200 Subject: 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 --- include/asm-generic/vmlinux.lds.h | 2 ++ include/linux/clocksource.h | 3 +++ 2 files changed, 5 insertions(+) (limited to 'include') diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 6a67ab94b553..8c6c626285c0 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -173,6 +173,7 @@ *(__##name##_of_table_end) #define CLKSRC_OF_TABLES() OF_TABLE(CONFIG_CLKSRC_OF, clksrc) +#define CLKSRC_RET_OF_TABLES() OF_TABLE(CONFIG_CLKSRC_OF, clksrc_ret) #define IRQCHIP_OF_MATCH_TABLE() OF_TABLE(CONFIG_IRQCHIP, irqchip) #define CLK_OF_TABLES() OF_TABLE(CONFIG_COMMON_CLK, clk) #define IOMMU_OF_TABLES() OF_TABLE(CONFIG_OF_IOMMU, iommu) @@ -531,6 +532,7 @@ CLK_OF_TABLES() \ RESERVEDMEM_OF_TABLES() \ CLKSRC_OF_TABLES() \ + CLKSRC_RET_OF_TABLES() \ IOMMU_OF_TABLES() \ CPU_METHOD_OF_TABLES() \ CPUIDLE_METHOD_OF_TABLES() \ diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h index 44a1aff22566..15c3839850f4 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h @@ -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 -- cgit v1.2.3