diff options
author | Ingo Molnar <mingo@elte.hu> | 2010-10-30 04:43:08 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-10-30 04:43:08 -0400 |
commit | 169ed55bd30305b933f52bfab32a58671d44ab68 (patch) | |
tree | 32e280957474f458901abfce16fa2a1687ef7497 /drivers/char/toshiba.c | |
parent | 3d7851b3cdd43a734e5cc4c643fd886ab28ad4d5 (diff) | |
parent | 45f81b1c96d9793e47ce925d257ea693ce0b193e (diff) |
Merge branch 'tip/perf/jump-label-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace into perf/urgent
Diffstat (limited to 'drivers/char/toshiba.c')
-rw-r--r-- | drivers/char/toshiba.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/char/toshiba.c b/drivers/char/toshiba.c index f8bc79f6de34..014c9d90d297 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"); |
@@ -95,6 +96,7 @@ static long tosh_ioctl(struct file *, unsigned int, | |||
95 | static const struct file_operations tosh_fops = { | 96 | static const struct file_operations tosh_fops = { |
96 | .owner = THIS_MODULE, | 97 | .owner = THIS_MODULE, |
97 | .unlocked_ioctl = tosh_ioctl, | 98 | .unlocked_ioctl = tosh_ioctl, |
99 | .llseek = noop_llseek, | ||
98 | }; | 100 | }; |
99 | 101 | ||
100 | static struct miscdevice tosh_device = { | 102 | static struct miscdevice tosh_device = { |
@@ -274,16 +276,16 @@ static long tosh_ioctl(struct file *fp, unsigned int cmd, unsigned long arg) | |||
274 | return -EINVAL; | 276 | return -EINVAL; |
275 | 277 | ||
276 | /* do we need to emulate the fan ? */ | 278 | /* do we need to emulate the fan ? */ |
277 | lock_kernel(); | 279 | mutex_lock(&tosh_mutex); |
278 | if (tosh_fan==1) { | 280 | if (tosh_fan==1) { |
279 | if (((ax==0xf300) || (ax==0xf400)) && (bx==0x0004)) { | 281 | if (((ax==0xf300) || (ax==0xf400)) && (bx==0x0004)) { |
280 | err = tosh_emulate_fan(®s); | 282 | err = tosh_emulate_fan(®s); |
281 | unlock_kernel(); | 283 | mutex_unlock(&tosh_mutex); |
282 | break; | 284 | break; |
283 | } | 285 | } |
284 | } | 286 | } |
285 | err = tosh_smm(®s); | 287 | err = tosh_smm(®s); |
286 | unlock_kernel(); | 288 | mutex_unlock(&tosh_mutex); |
287 | break; | 289 | break; |
288 | default: | 290 | default: |
289 | return -EINVAL; | 291 | return -EINVAL; |