set_kset_name("machinecheck"),
};
-DEFINE_PER_CPU(struct sys_device, device_mce);
+static DEFINE_PER_CPU(struct sys_device, device_mce);
/* Why are there no generic functions for this? */
#define ACCESSOR(name, var, start) \
}
#ifdef CONFIG_HOTPLUG_CPU
-static void mce_remove_device(unsigned int cpu)
+static __cpuinit void mce_remove_device(unsigned int cpu)
{
int i;
sysdev_remove_file(&per_cpu(device_mce,cpu), &attr_check_interval);
sysdev_unregister(&per_cpu(device_mce,cpu));
}
+#endif
/* Get notified when a cpu comes on/off. Be hotplug friendly. */
static int
case CPU_ONLINE:
mce_create_device(cpu);
break;
+#ifdef CONFIG_HOTPLUG_CPU
case CPU_DEAD:
mce_remove_device(cpu);
break;
+#endif
}
return NOTIFY_OK;
}
static struct notifier_block mce_cpu_notifier = {
.notifier_call = mce_cpu_callback,
};
-#endif
static __init int mce_init_device(void)
{
mce_create_device(i);
}
- register_hotcpu_notifier(&mce_cpu_notifier);
+ register_cpu_notifier(&mce_cpu_notifier);
misc_register(&mce_log_device);
return err;
}