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

[MIPS] Clocksource: Only install r4k counter as clocksource if present.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

+9 -3
+6 -1
arch/mips/kernel/csrc-r4k.c
··· 22 22 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 23 23 }; 24 24 25 - void __init init_mips_clocksource(void) 25 + int __init init_mips_clocksource(void) 26 26 { 27 + if (!cpu_has_counter || !mips_hpt_frequency) 28 + return -ENXIO; 29 + 27 30 /* Calclate a somewhat reasonable rating value */ 28 31 clocksource_mips.rating = 200 + mips_hpt_frequency / 10000000; 29 32 30 33 clocksource_set_clock(&clocksource_mips, mips_hpt_frequency); 31 34 32 35 clocksource_register(&clocksource_mips); 36 + 37 + return 0; 33 38 }
+3 -2
include/asm-mips/time.h
··· 64 64 * Initialize the count register as a clocksource 65 65 */ 66 66 #ifdef CONFIG_CEVT_R4K 67 - extern void init_mips_clocksource(void); 67 + extern int init_mips_clocksource(void); 68 68 #else 69 - static inline void init_mips_clocksource(void) 69 + static inline int init_mips_clocksource(void) 70 70 { 71 + return 0; 71 72 } 72 73 #endif 73 74