diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2008-03-12 14:58:10 +0100 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2008-03-12 15:14:42 +0100 |
commit | 69e634f1e27c8e5b954ea4be2d05dd744cabc0bc (patch) | |
tree | 0736d911ddd810ab36470f6121b9a73343307ee4 /arch/mips/kernel/csrc-r4k.c | |
parent | [MIPS] Lasat: fix LASAT_CASCADE_IRQ (diff) | |
download | linux-69e634f1e27c8e5b954ea4be2d05dd744cabc0bc.tar.xz linux-69e634f1e27c8e5b954ea4be2d05dd744cabc0bc.zip |
[MIPS] Clocksource: Only install r4k counter as clocksource if present.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel/csrc-r4k.c')
-rw-r--r-- | arch/mips/kernel/csrc-r4k.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/mips/kernel/csrc-r4k.c b/arch/mips/kernel/csrc-r4k.c index 0e2b5cd81f67..86e026f067bc 100644 --- a/arch/mips/kernel/csrc-r4k.c +++ b/arch/mips/kernel/csrc-r4k.c @@ -22,12 +22,17 @@ static struct clocksource clocksource_mips = { .flags = CLOCK_SOURCE_IS_CONTINUOUS, }; -void __init init_mips_clocksource(void) +int __init init_mips_clocksource(void) { + if (!cpu_has_counter || !mips_hpt_frequency) + return -ENXIO; + /* Calclate a somewhat reasonable rating value */ clocksource_mips.rating = 200 + mips_hpt_frequency / 10000000; clocksource_set_clock(&clocksource_mips, mips_hpt_frequency); clocksource_register(&clocksource_mips); + + return 0; } |