x86, msr: Use seek definitions instead of hard-coded values
[pandora-kernel.git] / arch / x86 / kernel / msr.c
index c9603ac..113e707 100644 (file)
@@ -22,6 +22,8 @@
  * an SMP box will direct the access to CPU %d.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/module.h>
 
 #include <linux/types.h>
@@ -50,11 +52,11 @@ static loff_t msr_seek(struct file *file, loff_t offset, int orig)
 
        mutex_lock(&inode->i_mutex);
        switch (orig) {
-       case 0:
+       case SEEK_SET:
                file->f_pos = offset;
                ret = file->f_pos;
                break;
-       case 1:
+       case SEEK_CUR:
                file->f_pos += offset;
                ret = file->f_pos;
                break;
@@ -206,7 +208,7 @@ static int msr_device_create(int cpu)
 
        dev = device_create(msr_class, NULL, MKDEV(MSR_MAJOR, cpu), NULL,
                            "msr%d", cpu);
-       return IS_ERR(dev) ? PTR_ERR(dev) : 0;
+       return PTR_ERR_OR_ZERO(dev);
 }
 
 static void msr_device_destroy(int cpu)
@@ -248,8 +250,7 @@ static int __init msr_init(void)
        i = 0;
 
        if (__register_chrdev(MSR_MAJOR, 0, NR_CPUS, "cpu/msr", &msr_fops)) {
-               printk(KERN_ERR "msr: unable to get major %d for msr\n",
-                      MSR_MAJOR);
+               pr_err("unable to get major %d for msr\n", MSR_MAJOR);
                err = -EBUSY;
                goto out;
        }