diff options
Diffstat (limited to 'arch/x86/kernel/msr.c')
-rw-r--r-- | arch/x86/kernel/msr.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c index c9603ac80de5..113e70784854 100644 --- a/arch/x86/kernel/msr.c +++ b/arch/x86/kernel/msr.c | |||
@@ -22,6 +22,8 @@ | |||
22 | * an SMP box will direct the access to CPU %d. | 22 | * an SMP box will direct the access to CPU %d. |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
26 | |||
25 | #include <linux/module.h> | 27 | #include <linux/module.h> |
26 | 28 | ||
27 | #include <linux/types.h> | 29 | #include <linux/types.h> |
@@ -50,11 +52,11 @@ static loff_t msr_seek(struct file *file, loff_t offset, int orig) | |||
50 | 52 | ||
51 | mutex_lock(&inode->i_mutex); | 53 | mutex_lock(&inode->i_mutex); |
52 | switch (orig) { | 54 | switch (orig) { |
53 | case 0: | 55 | case SEEK_SET: |
54 | file->f_pos = offset; | 56 | file->f_pos = offset; |
55 | ret = file->f_pos; | 57 | ret = file->f_pos; |
56 | break; | 58 | break; |
57 | case 1: | 59 | case SEEK_CUR: |
58 | file->f_pos += offset; | 60 | file->f_pos += offset; |
59 | ret = file->f_pos; | 61 | ret = file->f_pos; |
60 | break; | 62 | break; |
@@ -206,7 +208,7 @@ static int msr_device_create(int cpu) | |||
206 | 208 | ||
207 | dev = device_create(msr_class, NULL, MKDEV(MSR_MAJOR, cpu), NULL, | 209 | dev = device_create(msr_class, NULL, MKDEV(MSR_MAJOR, cpu), NULL, |
208 | "msr%d", cpu); | 210 | "msr%d", cpu); |
209 | return IS_ERR(dev) ? PTR_ERR(dev) : 0; | 211 | return PTR_ERR_OR_ZERO(dev); |
210 | } | 212 | } |
211 | 213 | ||
212 | static void msr_device_destroy(int cpu) | 214 | static void msr_device_destroy(int cpu) |
@@ -248,8 +250,7 @@ static int __init msr_init(void) | |||
248 | i = 0; | 250 | i = 0; |
249 | 251 | ||
250 | if (__register_chrdev(MSR_MAJOR, 0, NR_CPUS, "cpu/msr", &msr_fops)) { | 252 | if (__register_chrdev(MSR_MAJOR, 0, NR_CPUS, "cpu/msr", &msr_fops)) { |
251 | printk(KERN_ERR "msr: unable to get major %d for msr\n", | 253 | pr_err("unable to get major %d for msr\n", MSR_MAJOR); |
252 | MSR_MAJOR); | ||
253 | err = -EBUSY; | 254 | err = -EBUSY; |
254 | goto out; | 255 | goto out; |
255 | } | 256 | } |