diff options
Diffstat (limited to 'drivers/char/i8k.c')
-rw-r--r-- | drivers/char/i8k.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/drivers/char/i8k.c b/drivers/char/i8k.c index fc8cf7ac7f2b..3bc0eef88717 100644 --- a/drivers/char/i8k.c +++ b/drivers/char/i8k.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/seq_file.h> | 23 | #include <linux/seq_file.h> |
24 | #include <linux/dmi.h> | 24 | #include <linux/dmi.h> |
25 | #include <linux/capability.h> | 25 | #include <linux/capability.h> |
26 | #include <linux/mutex.h> | ||
26 | #include <asm/uaccess.h> | 27 | #include <asm/uaccess.h> |
27 | #include <asm/io.h> | 28 | #include <asm/io.h> |
28 | 29 | ||
@@ -55,6 +56,7 @@ | |||
55 | 56 | ||
56 | #define I8K_TEMPERATURE_BUG 1 | 57 | #define I8K_TEMPERATURE_BUG 1 |
57 | 58 | ||
59 | static DEFINE_MUTEX(i8k_mutex); | ||
58 | static char bios_version[4]; | 60 | static char bios_version[4]; |
59 | 61 | ||
60 | MODULE_AUTHOR("Massimo Dal Zotto (dz@debian.org)"); | 62 | MODULE_AUTHOR("Massimo Dal Zotto (dz@debian.org)"); |
@@ -82,8 +84,7 @@ module_param(fan_mult, int, 0); | |||
82 | MODULE_PARM_DESC(fan_mult, "Factor to multiply fan speed with"); | 84 | MODULE_PARM_DESC(fan_mult, "Factor to multiply fan speed with"); |
83 | 85 | ||
84 | static int i8k_open_fs(struct inode *inode, struct file *file); | 86 | static int i8k_open_fs(struct inode *inode, struct file *file); |
85 | static int i8k_ioctl(struct inode *, struct file *, unsigned int, | 87 | static long i8k_ioctl(struct file *, unsigned int, unsigned long); |
86 | unsigned long); | ||
87 | 88 | ||
88 | static const struct file_operations i8k_fops = { | 89 | static const struct file_operations i8k_fops = { |
89 | .owner = THIS_MODULE, | 90 | .owner = THIS_MODULE, |
@@ -91,7 +92,7 @@ static const struct file_operations i8k_fops = { | |||
91 | .read = seq_read, | 92 | .read = seq_read, |
92 | .llseek = seq_lseek, | 93 | .llseek = seq_lseek, |
93 | .release = single_release, | 94 | .release = single_release, |
94 | .ioctl = i8k_ioctl, | 95 | .unlocked_ioctl = i8k_ioctl, |
95 | }; | 96 | }; |
96 | 97 | ||
97 | struct smm_regs { | 98 | struct smm_regs { |
@@ -307,8 +308,8 @@ static int i8k_get_dell_signature(int req_fn) | |||
307 | return regs.eax == 1145651527 && regs.edx == 1145392204 ? 0 : -1; | 308 | return regs.eax == 1145651527 && regs.edx == 1145392204 ? 0 : -1; |
308 | } | 309 | } |
309 | 310 | ||
310 | static int i8k_ioctl(struct inode *ip, struct file *fp, unsigned int cmd, | 311 | static int |
311 | unsigned long arg) | 312 | i8k_ioctl_unlocked(struct file *fp, unsigned int cmd, unsigned long arg) |
312 | { | 313 | { |
313 | int val = 0; | 314 | int val = 0; |
314 | int speed; | 315 | int speed; |
@@ -395,6 +396,17 @@ static int i8k_ioctl(struct inode *ip, struct file *fp, unsigned int cmd, | |||
395 | return 0; | 396 | return 0; |
396 | } | 397 | } |
397 | 398 | ||
399 | static long i8k_ioctl(struct file *fp, unsigned int cmd, unsigned long arg) | ||
400 | { | ||
401 | long ret; | ||
402 | |||
403 | mutex_lock(&i8k_mutex); | ||
404 | ret = i8k_ioctl_unlocked(fp, cmd, arg); | ||
405 | mutex_unlock(&i8k_mutex); | ||
406 | |||
407 | return ret; | ||
408 | } | ||
409 | |||
398 | /* | 410 | /* |
399 | * Print the information for /proc/i8k. | 411 | * Print the information for /proc/i8k. |
400 | */ | 412 | */ |