diff options
author | Magnus Damm <damm@igel.co.jp> | 2009-01-22 04:55:49 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-01-29 02:45:47 -0500 |
commit | 07821d3310996746a2cf1e9c705ffe64223d1112 (patch) | |
tree | e21c5caf6d1346ed43cbb599be4945364f1e59a2 /arch/sh/kernel/time_32.c | |
parent | 70f0800133b2a6d694c10908b8673a5327b3bfd6 (diff) |
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/kernel/time_32.c')
-rw-r--r-- | arch/sh/kernel/time_32.c | 10 |
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 = { | |||
181 | 181 | ||
182 | static int __init timer_init_sysfs(void) | 182 | static int __init timer_init_sysfs(void) |
183 | { | 183 | { |
184 | int ret = sysdev_class_register(&timer_sysclass); | 184 | int ret; |
185 | |||
186 | if (!sys_timer) | ||
187 | return 0; | ||
188 | |||
189 | ret = sysdev_class_register(&timer_sysclass); | ||
185 | if (ret != 0) | 190 | if (ret != 0) |
186 | return ret; | 191 | return ret; |
187 | 192 | ||
@@ -230,5 +235,8 @@ void __init time_init(void) | |||
230 | * initialized for us. | 235 | * initialized for us. |
231 | */ | 236 | */ |
232 | sys_timer = get_sys_timer(); | 237 | sys_timer = get_sys_timer(); |
238 | if (unlikely(!sys_timer)) | ||
239 | panic("System timer missing.\n"); | ||
240 | |||
233 | printk(KERN_INFO "Using %s for system timer\n", sys_timer->name); | 241 | printk(KERN_INFO "Using %s for system timer\n", sys_timer->name); |
234 | } | 242 | } |