diff options
Diffstat (limited to 'drivers/char/toshiba.c')
-rw-r--r-- | drivers/char/toshiba.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/char/toshiba.c b/drivers/char/toshiba.c index f8bc79f6de34..f8f09ab0b170 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 | #include <linux/smp_lock.h> | 71 | #include <linux/mutex.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 |
@@ -78,6 +78,7 @@ MODULE_AUTHOR("Jonathan Buzzard <jonathan@buzzard.org.uk>"); | |||
78 | MODULE_DESCRIPTION("Toshiba laptop SMM driver"); | 78 | MODULE_DESCRIPTION("Toshiba laptop SMM driver"); |
79 | MODULE_SUPPORTED_DEVICE("toshiba"); | 79 | MODULE_SUPPORTED_DEVICE("toshiba"); |
80 | 80 | ||
81 | static DEFINE_MUTEX(tosh_mutex); | ||
81 | static int tosh_fn; | 82 | static int tosh_fn; |
82 | module_param_named(fn, tosh_fn, int, 0); | 83 | module_param_named(fn, tosh_fn, int, 0); |
83 | MODULE_PARM_DESC(fn, "User specified Fn key detection port"); | 84 | MODULE_PARM_DESC(fn, "User specified Fn key detection port"); |
@@ -274,16 +275,16 @@ static long tosh_ioctl(struct file *fp, unsigned int cmd, unsigned long arg) | |||
274 | return -EINVAL; | 275 | return -EINVAL; |
275 | 276 | ||
276 | /* do we need to emulate the fan ? */ | 277 | /* do we need to emulate the fan ? */ |
277 | lock_kernel(); | 278 | mutex_lock(&tosh_mutex); |
278 | if (tosh_fan==1) { | 279 | if (tosh_fan==1) { |
279 | if (((ax==0xf300) || (ax==0xf400)) && (bx==0x0004)) { | 280 | if (((ax==0xf300) || (ax==0xf400)) && (bx==0x0004)) { |
280 | err = tosh_emulate_fan(®s); | 281 | err = tosh_emulate_fan(®s); |
281 | unlock_kernel(); | 282 | mutex_unlock(&tosh_mutex); |
282 | break; | 283 | break; |
283 | } | 284 | } |
284 | } | 285 | } |
285 | err = tosh_smm(®s); | 286 | err = tosh_smm(®s); |
286 | unlock_kernel(); | 287 | mutex_unlock(&tosh_mutex); |
287 | break; | 288 | break; |
288 | default: | 289 | default: |
289 | return -EINVAL; | 290 | return -EINVAL; |