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>
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;
* 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);
}