Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clocksource: fixup ux500 build problems

Based on a patch from Arnd Bergmann this fixes up the build
problem of assigning a non-existing global when the ux500 PRCMU
timer is not linked in by passing its base address to the init
function. We also add a missing <linux/errno.h> inclusion and
staticize the dummy function.

Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

+12 -9
+6 -3
arch/arm/mach-ux500/timer.c
··· 5 5 * Author: Mattias Wallin <mattias.wallin@stericsson.com> for ST-Ericsson 6 6 */ 7 7 #include <linux/io.h> 8 + #include <linux/errno.h> 8 9 #include <linux/clksrc-dbx500-prcmu.h> 9 10 10 11 #include <asm/localtimer.h> ··· 17 16 18 17 static void __init ux500_timer_init(void) 19 18 { 19 + void __iomem *prcmu_timer_base; 20 + 20 21 if (cpu_is_u5500()) { 21 22 #ifdef CONFIG_LOCAL_TIMERS 22 23 twd_base = __io_address(U5500_TWD_BASE); 23 24 #endif 24 25 mtu_base = __io_address(U5500_MTU0_BASE); 25 - clksrc_dbx500_timer_base = __io_address(U5500_PRCMU_TIMER_3_BASE); 26 + prcmu_timer_base = __io_address(U5500_PRCMU_TIMER_3_BASE); 26 27 } else if (cpu_is_u8500()) { 27 28 #ifdef CONFIG_LOCAL_TIMERS 28 29 twd_base = __io_address(U8500_TWD_BASE); 29 30 #endif 30 31 mtu_base = __io_address(U8500_MTU0_BASE); 31 - clksrc_dbx500_timer_base = __io_address(U8500_PRCMU_TIMER_4_BASE); 32 + prcmu_timer_base = __io_address(U8500_PRCMU_TIMER_4_BASE); 32 33 } else { 33 34 ux500_unknown_soc(); 34 35 } ··· 53 50 */ 54 51 55 52 nmdk_timer_init(); 56 - clksrc_dbx500_prcmu_init(); 53 + clksrc_dbx500_prcmu_init(prcmu_timer_base); 57 54 } 58 55 59 56 static void ux500_timer_reset(void)
+4 -2
drivers/clocksource/clksrc-dbx500-prcmu.c
··· 31 31 32 32 #define SCHED_CLOCK_MIN_WRAP 131072 /* 2^32 / 32768 */ 33 33 34 - void __iomem *clksrc_dbx500_timer_base; 34 + static void __iomem *clksrc_dbx500_timer_base; 35 35 36 36 static cycle_t clksrc_dbx500_prcmu_read(struct clocksource *cs) 37 37 { ··· 79 79 } 80 80 #endif 81 81 82 - void __init clksrc_dbx500_prcmu_init(void) 82 + void __init clksrc_dbx500_prcmu_init(void __iomem *base) 83 83 { 84 + clksrc_dbx500_timer_base = base; 85 + 84 86 /* 85 87 * The A9 sub system expects the timer to be configured as 86 88 * a continous looping timer.
+2 -4
include/linux/clksrc-dbx500-prcmu.h
··· 11 11 #include <linux/init.h> 12 12 #include <linux/io.h> 13 13 14 - extern void __iomem *clksrc_dbx500_timer_base; 15 - 16 14 #ifdef CONFIG_CLKSRC_DBX500_PRCMU 17 - void __init clksrc_dbx500_prcmu_init(void); 15 + void __init clksrc_dbx500_prcmu_init(void __iomem *base); 18 16 #else 19 - void __init clksrc_dbx500_prcmu_init(void) {} 17 + static inline void __init clksrc_dbx500_prcmu_init(void __iomem *base) {} 20 18 #endif 21 19 22 20 #endif