diff options
Diffstat (limited to 'drivers/char/mbcs.c')
-rw-r--r-- | drivers/char/mbcs.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/char/mbcs.c b/drivers/char/mbcs.c index 83bef4efe376..1aeaaba680d2 100644 --- a/drivers/char/mbcs.c +++ b/drivers/char/mbcs.c | |||
@@ -25,7 +25,6 @@ | |||
25 | #include <linux/mm.h> | 25 | #include <linux/mm.h> |
26 | #include <linux/uio.h> | 26 | #include <linux/uio.h> |
27 | #include <linux/mutex.h> | 27 | #include <linux/mutex.h> |
28 | #include <linux/smp_lock.h> | ||
29 | #include <linux/slab.h> | 28 | #include <linux/slab.h> |
30 | #include <asm/io.h> | 29 | #include <asm/io.h> |
31 | #include <asm/uaccess.h> | 30 | #include <asm/uaccess.h> |
@@ -42,6 +41,7 @@ | |||
42 | #else | 41 | #else |
43 | #define DBG(fmt...) | 42 | #define DBG(fmt...) |
44 | #endif | 43 | #endif |
44 | static DEFINE_MUTEX(mbcs_mutex); | ||
45 | static int mbcs_major; | 45 | static int mbcs_major; |
46 | 46 | ||
47 | static LIST_HEAD(soft_list); | 47 | static LIST_HEAD(soft_list); |
@@ -385,19 +385,19 @@ static int mbcs_open(struct inode *ip, struct file *fp) | |||
385 | struct mbcs_soft *soft; | 385 | struct mbcs_soft *soft; |
386 | int minor; | 386 | int minor; |
387 | 387 | ||
388 | lock_kernel(); | 388 | mutex_lock(&mbcs_mutex); |
389 | minor = iminor(ip); | 389 | minor = iminor(ip); |
390 | 390 | ||
391 | /* Nothing protects access to this list... */ | 391 | /* Nothing protects access to this list... */ |
392 | list_for_each_entry(soft, &soft_list, list) { | 392 | list_for_each_entry(soft, &soft_list, list) { |
393 | if (soft->nasid == minor) { | 393 | if (soft->nasid == minor) { |
394 | fp->private_data = soft->cxdev; | 394 | fp->private_data = soft->cxdev; |
395 | unlock_kernel(); | 395 | mutex_unlock(&mbcs_mutex); |
396 | return 0; | 396 | return 0; |
397 | } | 397 | } |
398 | } | 398 | } |
399 | 399 | ||
400 | unlock_kernel(); | 400 | mutex_unlock(&mbcs_mutex); |
401 | return -ENODEV; | 401 | return -ENODEV; |
402 | } | 402 | } |
403 | 403 | ||