dect
/
linux-2.6
Archived
13
0
Fork 0

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>
This commit is contained in:
Magnus Damm 2009-01-22 09:55:49 +00:00 committed by Paul Mundt
parent 70f0800133
commit 07821d3310
1 changed files with 9 additions and 1 deletions

View File

@ -181,7 +181,12 @@ static struct sysdev_class timer_sysclass = {
static int __init timer_init_sysfs(void) 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) if (ret != 0)
return ret; return ret;
@ -230,5 +235,8 @@ void __init time_init(void)
* initialized for us. * initialized for us.
*/ */
sys_timer = get_sys_timer(); 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); printk(KERN_INFO "Using %s for system timer\n", sys_timer->name);
} }