diff options
| -rw-r--r-- | drivers/char/toshiba.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/char/toshiba.c b/drivers/char/toshiba.c index 663cd15d7c78..f8bc79f6de34 100644 --- a/drivers/char/toshiba.c +++ b/drivers/char/toshiba.c | |||
| @@ -68,7 +68,7 @@ | |||
| 68 | #include <linux/stat.h> | 68 | #include <linux/stat.h> |
| 69 | #include <linux/proc_fs.h> | 69 | #include <linux/proc_fs.h> |
| 70 | #include <linux/seq_file.h> | 70 | #include <linux/seq_file.h> |
| 71 | 71 | #include <linux/smp_lock.h> | |
| 72 | #include <linux/toshiba.h> | 72 | #include <linux/toshiba.h> |
| 73 | 73 | ||
| 74 | #define TOSH_MINOR_DEV 181 | 74 | #define TOSH_MINOR_DEV 181 |
| @@ -88,13 +88,13 @@ static int tosh_date; | |||
| 88 | static int tosh_sci; | 88 | static int tosh_sci; |
| 89 | static int tosh_fan; | 89 | static int tosh_fan; |
| 90 | 90 | ||
| 91 | static int tosh_ioctl(struct inode *, struct file *, unsigned int, | 91 | static long tosh_ioctl(struct file *, unsigned int, |
| 92 | unsigned long); | 92 | unsigned long); |
| 93 | 93 | ||
| 94 | 94 | ||
| 95 | static const struct file_operations tosh_fops = { | 95 | static const struct file_operations tosh_fops = { |
| 96 | .owner = THIS_MODULE, | 96 | .owner = THIS_MODULE, |
| 97 | .ioctl = tosh_ioctl, | 97 | .unlocked_ioctl = tosh_ioctl, |
| 98 | }; | 98 | }; |
| 99 | 99 | ||
| 100 | static struct miscdevice tosh_device = { | 100 | static struct miscdevice tosh_device = { |
| @@ -252,8 +252,7 @@ int tosh_smm(SMMRegisters *regs) | |||
| 252 | EXPORT_SYMBOL(tosh_smm); | 252 | EXPORT_SYMBOL(tosh_smm); |
| 253 | 253 | ||
| 254 | 254 | ||
| 255 | static int tosh_ioctl(struct inode *ip, struct file *fp, unsigned int cmd, | 255 | static long tosh_ioctl(struct file *fp, unsigned int cmd, unsigned long arg) |
| 256 | unsigned long arg) | ||
| 257 | { | 256 | { |
| 258 | SMMRegisters regs; | 257 | SMMRegisters regs; |
| 259 | SMMRegisters __user *argp = (SMMRegisters __user *)arg; | 258 | SMMRegisters __user *argp = (SMMRegisters __user *)arg; |
| @@ -275,13 +274,16 @@ static int tosh_ioctl(struct inode *ip, struct file *fp, unsigned int cmd, | |||
| 275 | return -EINVAL; | 274 | return -EINVAL; |
| 276 | 275 | ||
| 277 | /* do we need to emulate the fan ? */ | 276 | /* do we need to emulate the fan ? */ |
| 277 | lock_kernel(); | ||
| 278 | if (tosh_fan==1) { | 278 | if (tosh_fan==1) { |
| 279 | if (((ax==0xf300) || (ax==0xf400)) && (bx==0x0004)) { | 279 | if (((ax==0xf300) || (ax==0xf400)) && (bx==0x0004)) { |
| 280 | err = tosh_emulate_fan(®s); | 280 | err = tosh_emulate_fan(®s); |
| 281 | unlock_kernel(); | ||
| 281 | break; | 282 | break; |
| 282 | } | 283 | } |
| 283 | } | 284 | } |
| 284 | err = tosh_smm(®s); | 285 | err = tosh_smm(®s); |
| 286 | unlock_kernel(); | ||
| 285 | break; | 287 | break; |
| 286 | default: | 288 | default: |
| 287 | return -EINVAL; | 289 | return -EINVAL; |
