Merge branch 'x86-cpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[sfrench/cifs-2.6.git] / arch / x86 / kernel / msr.c
index 7dd950094178712532ce8c02ef96542f0ec9f68f..553449951b84b9c2d2f24afc2521fdd53adb7c8f 100644 (file)
@@ -174,21 +174,17 @@ static int msr_open(struct inode *inode, struct file *file)
 {
        unsigned int cpu = iminor(file->f_path.dentry->d_inode);
        struct cpuinfo_x86 *c = &cpu_data(cpu);
-       int ret = 0;
 
-       lock_kernel();
        cpu = iminor(file->f_path.dentry->d_inode);
 
-       if (cpu >= nr_cpu_ids || !cpu_online(cpu)) {
-               ret = -ENXIO;   /* No such CPU */
-               goto out;
-       }
+       if (cpu >= nr_cpu_ids || !cpu_online(cpu))
+               return -ENXIO;  /* No such CPU */
+
        c = &cpu_data(cpu);
        if (!cpu_has(c, X86_FEATURE_MSR))
-               ret = -EIO;     /* MSR not supported */
-out:
-       unlock_kernel();
-       return ret;
+               return -EIO;    /* MSR not supported */
+
+       return 0;
 }
 
 /*
@@ -241,7 +237,7 @@ static struct notifier_block __refdata msr_class_cpu_notifier = {
        .notifier_call = msr_class_cpu_callback,
 };
 
-static char *msr_nodename(struct device *dev)
+static char *msr_devnode(struct device *dev, mode_t *mode)
 {
        return kasprintf(GFP_KERNEL, "cpu/%u/msr", MINOR(dev->devt));
 }
@@ -262,7 +258,7 @@ static int __init msr_init(void)
                err = PTR_ERR(msr_class);
                goto out_chrdev;
        }
-       msr_class->nodename = msr_nodename;
+       msr_class->devnode = msr_devnode;
        for_each_online_cpu(i) {
                err = msr_device_create(i);
                if (err != 0)