aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2006-06-30 04:55:29 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-30 14:25:34 -0400
commite09793bb9182115e6f5d15fd6571ac2b72d7a08a (patch)
treed6e399ec606854cf9a1d016fcc403727d7906b08
parent1017f6afd578fe519d316d7148356703c04e8f03 (diff)
[PATCH] msr.c: use register_hotcpu_notifier()
register_cpu_notifier() cannot do anything in a module, in a !CONFIG_HOTPLUG_CPU kernel. Cc: Chandra Seetharaman <sekharan@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--arch/i386/kernel/msr.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/arch/i386/kernel/msr.c b/arch/i386/kernel/msr.c
index d022cb8fd725..5c29a9fb4a44 100644
--- a/arch/i386/kernel/msr.c
+++ b/arch/i386/kernel/msr.c
@@ -251,7 +251,9 @@ static int msr_class_device_create(int i)
251 return err; 251 return err;
252} 252}
253 253
254static int msr_class_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) 254#ifdef CONFIG_HOTPLUG_CPU
255static int msr_class_cpu_callback(struct notifier_block *nfb,
256 unsigned long action, void *hcpu)
255{ 257{
256 unsigned int cpu = (unsigned long)hcpu; 258 unsigned int cpu = (unsigned long)hcpu;
257 259
@@ -270,6 +272,7 @@ static struct notifier_block __cpuinitdata msr_class_cpu_notifier =
270{ 272{
271 .notifier_call = msr_class_cpu_callback, 273 .notifier_call = msr_class_cpu_callback,
272}; 274};
275#endif
273 276
274static int __init msr_init(void) 277static int __init msr_init(void)
275{ 278{
@@ -292,7 +295,7 @@ static int __init msr_init(void)
292 if (err != 0) 295 if (err != 0)
293 goto out_class; 296 goto out_class;
294 } 297 }
295 register_cpu_notifier(&msr_class_cpu_notifier); 298 register_hotcpu_notifier(&msr_class_cpu_notifier);
296 299
297 err = 0; 300 err = 0;
298 goto out; 301 goto out;
@@ -315,7 +318,7 @@ static void __exit msr_exit(void)
315 class_device_destroy(msr_class, MKDEV(MSR_MAJOR, cpu)); 318 class_device_destroy(msr_class, MKDEV(MSR_MAJOR, cpu));
316 class_destroy(msr_class); 319 class_destroy(msr_class);
317 unregister_chrdev(MSR_MAJOR, "cpu/msr"); 320 unregister_chrdev(MSR_MAJOR, "cpu/msr");
318 unregister_cpu_notifier(&msr_class_cpu_notifier); 321 unregister_hotcpu_notifier(&msr_class_cpu_notifier);
319} 322}
320 323
321module_init(msr_init); 324module_init(msr_init);