]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
device create: x86: convert device_create to device_create_drvdata
authorGreg Kroah-Hartman <gregkh@suse.de>
Wed, 21 May 2008 19:52:33 +0000 (12:52 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 22 Jul 2008 04:54:46 +0000 (21:54 -0700)
device_create() is race-prone, so use the race-free
device_create_drvdata() instead as device_create() is going away.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/x86/kernel/cpuid.c
arch/x86/kernel/msr.c

index 2de5fa2bbf77061c31d686035e0d48ca266c49cf..14b11b3be31ca64d600cb7281edb93f5228809b9 100644 (file)
@@ -141,8 +141,8 @@ static __cpuinit int cpuid_device_create(int cpu)
 {
        struct device *dev;
 
-       dev = device_create(cpuid_class, NULL, MKDEV(CPUID_MAJOR, cpu),
-                           "cpu%d", cpu);
+       dev = device_create_drvdata(cpuid_class, NULL, MKDEV(CPUID_MAJOR, cpu),
+                                   NULL, "cpu%d", cpu);
        return IS_ERR(dev) ? PTR_ERR(dev) : 0;
 }
 
index a153b3905f60591cb6fb627cad9dcc6e529e25cb..9fd8095524474aa7ef0a999c2746c92c8a166565 100644 (file)
@@ -149,8 +149,8 @@ static int __cpuinit msr_device_create(int cpu)
 {
        struct device *dev;
 
-       dev = device_create(msr_class, NULL, MKDEV(MSR_MAJOR, cpu),
-                           "msr%d", cpu);
+       dev = device_create_drvdata(msr_class, NULL, MKDEV(MSR_MAJOR, cpu),
+                                   NULL, "msr%d", cpu);
        return IS_ERR(dev) ? PTR_ERR(dev) : 0;
 }