summaryrefslogtreecommitdiffstats
path: root/arch/sh
diff options
context:
space:
mode:
authorMagnus Damm <damm@igel.co.jp>2009-01-22 10:55:49 +0100
committerPaul Mundt <lethal@linux-sh.org>2009-01-29 08:45:47 +0100
commit07821d3310996746a2cf1e9c705ffe64223d1112 (patch)
treee21c5caf6d1346ed43cbb599be4945364f1e59a2 /arch/sh
parentsh: tmu disable support (diff)
downloadlinux-07821d3310996746a2cf1e9c705ffe64223d1112.tar.xz
linux-07821d3310996746a2cf1e9c705ffe64223d1112.zip
sh: fix no sys_timer case
Handle the case with a sys_timer set to NULL. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh')
-rw-r--r--arch/sh/kernel/time_32.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/sh/kernel/time_32.c b/arch/sh/kernel/time_32.c
index ca22eef669ae..766554ba2a5b 100644
--- a/arch/sh/kernel/time_32.c
+++ b/arch/sh/kernel/time_32.c
@@ -181,7 +181,12 @@ static struct sysdev_class timer_sysclass = {
static int __init timer_init_sysfs(void)
{
- int ret = sysdev_class_register(&timer_sysclass);
+ int ret;
+
+ if (!sys_timer)
+ return 0;
+
+ ret = sysdev_class_register(&timer_sysclass);
if (ret != 0)
return ret;
@@ -230,5 +235,8 @@ void __init time_init(void)
* initialized for us.
*/
sys_timer = get_sys_timer();
+ if (unlikely(!sys_timer))
+ panic("System timer missing.\n");
+
printk(KERN_INFO "Using %s for system timer\n", sys_timer->name);
}