Merge to Fedora kernel-2.6.18-1.2224_FC5 patched with stable patch-2.6.18.1-vs2.0...
[linux-2.6.git] / arch / i386 / kernel / cpuid.c
index 1d9a4ab..fde8bea 100644 (file)
@@ -24,7 +24,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/config.h>
 
 #include <linux/types.h>
 #include <linux/errno.h>
@@ -168,6 +167,7 @@ static int cpuid_class_device_create(int i)
        return err;
 }
 
+#ifdef CONFIG_HOTPLUG_CPU
 static int cpuid_class_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
 {
        unsigned int cpu = (unsigned long)hcpu;
@@ -183,10 +183,11 @@ static int cpuid_class_cpu_callback(struct notifier_block *nfb, unsigned long ac
        return NOTIFY_OK;
 }
 
-static struct notifier_block cpuid_class_cpu_notifier =
+static struct notifier_block __cpuinitdata cpuid_class_cpu_notifier =
 {
        .notifier_call = cpuid_class_cpu_callback,
 };
+#endif /* !CONFIG_HOTPLUG_CPU */
 
 static int __init cpuid_init(void)
 {
@@ -209,7 +210,7 @@ static int __init cpuid_init(void)
                if (err != 0) 
                        goto out_class;
        }
-       register_cpu_notifier(&cpuid_class_cpu_notifier);
+       register_hotcpu_notifier(&cpuid_class_cpu_notifier);
 
        err = 0;
        goto out;
@@ -234,7 +235,7 @@ static void __exit cpuid_exit(void)
                class_device_destroy(cpuid_class, MKDEV(CPUID_MAJOR, cpu));
        class_destroy(cpuid_class);
        unregister_chrdev(CPUID_MAJOR, "cpu/cpuid");
-       unregister_cpu_notifier(&cpuid_class_cpu_notifier);
+       unregister_hotcpu_notifier(&cpuid_class_cpu_notifier);
 }
 
 module_init(cpuid_init);