diff options
Diffstat (limited to 'arch/mips/kernel/csrc-ioasic.c')
-rw-r--r-- | arch/mips/kernel/csrc-ioasic.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/mips/kernel/csrc-ioasic.c b/arch/mips/kernel/csrc-ioasic.c index 87e88feb4a25..6cbbf6e106b9 100644 --- a/arch/mips/kernel/csrc-ioasic.c +++ b/arch/mips/kernel/csrc-ioasic.c | |||
@@ -37,7 +37,7 @@ static struct clocksource clocksource_dec = { | |||
37 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 37 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
38 | }; | 38 | }; |
39 | 39 | ||
40 | void __init dec_ioasic_clocksource_init(void) | 40 | int __init dec_ioasic_clocksource_init(void) |
41 | { | 41 | { |
42 | unsigned int freq; | 42 | unsigned int freq; |
43 | u32 start, end; | 43 | u32 start, end; |
@@ -56,8 +56,14 @@ void __init dec_ioasic_clocksource_init(void) | |||
56 | end = dec_ioasic_hpt_read(&clocksource_dec); | 56 | end = dec_ioasic_hpt_read(&clocksource_dec); |
57 | 57 | ||
58 | freq = (end - start) * 8; | 58 | freq = (end - start) * 8; |
59 | |||
60 | /* An early revision of the I/O ASIC didn't have the counter. */ | ||
61 | if (!freq) | ||
62 | return -ENXIO; | ||
63 | |||
59 | printk(KERN_INFO "I/O ASIC clock frequency %dHz\n", freq); | 64 | printk(KERN_INFO "I/O ASIC clock frequency %dHz\n", freq); |
60 | 65 | ||
61 | clocksource_dec.rating = 200 + freq / 10000000; | 66 | clocksource_dec.rating = 200 + freq / 10000000; |
62 | clocksource_register_hz(&clocksource_dec, freq); | 67 | clocksource_register_hz(&clocksource_dec, freq); |
68 | return 0; | ||
63 | } | 69 | } |