Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a271aaf15f492d202def1b34e447107b60fe4ece
Commit:     a271aaf15f492d202def1b34e447107b60fe4ece
Parent:     ac11d0601bbe73c92e31b393eeb1225593788d4c
Author:     Greg Kroah-Hartman <[EMAIL PROTECTED]>
AuthorDate: Mon Aug 7 22:19:37 2006 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Fri Dec 1 14:52:00 2006 -0800

    Driver core: convert msr code to use struct device
    
    Converts from using struct "class_device" to "struct device" making
    everything show up properly in /sys/devices/ with symlinks from the
    /sys/class directory.
    
    Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 arch/i386/kernel/msr.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/arch/i386/kernel/msr.c b/arch/i386/kernel/msr.c
index d535cdb..a773f77 100644
--- a/arch/i386/kernel/msr.c
+++ b/arch/i386/kernel/msr.c
@@ -239,14 +239,14 @@ static struct file_operations msr_fops =
        .open = msr_open,
 };
 
-static int msr_class_device_create(int i)
+static int msr_device_create(int i)
 {
        int err = 0;
-       struct class_device *class_err;
+       struct device *dev;
 
-       class_err = class_device_create(msr_class, NULL, MKDEV(MSR_MAJOR, i), 
NULL, "msr%d",i);
-       if (IS_ERR(class_err)) 
-               err = PTR_ERR(class_err);
+       dev = device_create(msr_class, NULL, MKDEV(MSR_MAJOR, i), "msr%d",i);
+       if (IS_ERR(dev))
+               err = PTR_ERR(dev);
        return err;
 }
 
@@ -258,10 +258,10 @@ static int msr_class_cpu_callback(struct
 
        switch (action) {
        case CPU_ONLINE:
-               msr_class_device_create(cpu);
+               msr_device_create(cpu);
                break;
        case CPU_DEAD:
-               class_device_destroy(msr_class, MKDEV(MSR_MAJOR, cpu));
+               device_destroy(msr_class, MKDEV(MSR_MAJOR, cpu));
                break;
        }
        return NOTIFY_OK;
@@ -290,7 +290,7 @@ static int __init msr_init(void)
                goto out_chrdev;
        }
        for_each_online_cpu(i) {
-               err = msr_class_device_create(i);
+               err = msr_device_create(i);
                if (err != 0)
                        goto out_class;
        }
@@ -302,7 +302,7 @@ static int __init msr_init(void)
 out_class:
        i = 0;
        for_each_online_cpu(i)
-               class_device_destroy(msr_class, MKDEV(MSR_MAJOR, i));
+               device_destroy(msr_class, MKDEV(MSR_MAJOR, i));
        class_destroy(msr_class);
 out_chrdev:
        unregister_chrdev(MSR_MAJOR, "cpu/msr");
@@ -314,7 +314,7 @@ static void __exit msr_exit(void)
 {
        int cpu = 0;
        for_each_online_cpu(cpu)
-               class_device_destroy(msr_class, MKDEV(MSR_MAJOR, cpu));
+               device_destroy(msr_class, MKDEV(MSR_MAJOR, cpu));
        class_destroy(msr_class);
        unregister_chrdev(MSR_MAJOR, "cpu/msr");
        unregister_hotcpu_notifier(&msr_class_cpu_notifier);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to