diff options
Diffstat (limited to 'drivers/char/ppdev.c')
-rw-r--r-- | drivers/char/ppdev.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/char/ppdev.c b/drivers/char/ppdev.c index 02abfddce45a..723152d978a9 100644 --- a/drivers/char/ppdev.c +++ b/drivers/char/ppdev.c | |||
@@ -67,7 +67,7 @@ | |||
67 | #include <linux/slab.h> | 67 | #include <linux/slab.h> |
68 | #include <linux/major.h> | 68 | #include <linux/major.h> |
69 | #include <linux/ppdev.h> | 69 | #include <linux/ppdev.h> |
70 | #include <linux/smp_lock.h> | 70 | #include <linux/mutex.h> |
71 | #include <linux/uaccess.h> | 71 | #include <linux/uaccess.h> |
72 | 72 | ||
73 | #define PP_VERSION "ppdev: user-space parallel port driver" | 73 | #define PP_VERSION "ppdev: user-space parallel port driver" |
@@ -97,6 +97,7 @@ struct pp_struct { | |||
97 | /* ROUND_UP macro from fs/select.c */ | 97 | /* ROUND_UP macro from fs/select.c */ |
98 | #define ROUND_UP(x,y) (((x)+(y)-1)/(y)) | 98 | #define ROUND_UP(x,y) (((x)+(y)-1)/(y)) |
99 | 99 | ||
100 | static DEFINE_MUTEX(pp_do_mutex); | ||
100 | static inline void pp_enable_irq (struct pp_struct *pp) | 101 | static inline void pp_enable_irq (struct pp_struct *pp) |
101 | { | 102 | { |
102 | struct parport *port = pp->pdev->port; | 103 | struct parport *port = pp->pdev->port; |
@@ -630,9 +631,9 @@ static int pp_do_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
630 | static long pp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | 631 | static long pp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
631 | { | 632 | { |
632 | long ret; | 633 | long ret; |
633 | lock_kernel(); | 634 | mutex_lock(&pp_do_mutex); |
634 | ret = pp_do_ioctl(file, cmd, arg); | 635 | ret = pp_do_ioctl(file, cmd, arg); |
635 | unlock_kernel(); | 636 | mutex_unlock(&pp_do_mutex); |
636 | return ret; | 637 | return ret; |
637 | } | 638 | } |
638 | 639 | ||
@@ -641,7 +642,6 @@ static int pp_open (struct inode * inode, struct file * file) | |||
641 | unsigned int minor = iminor(inode); | 642 | unsigned int minor = iminor(inode); |
642 | struct pp_struct *pp; | 643 | struct pp_struct *pp; |
643 | 644 | ||
644 | cycle_kernel_lock(); | ||
645 | if (minor >= PARPORT_MAX) | 645 | if (minor >= PARPORT_MAX) |
646 | return -ENXIO; | 646 | return -ENXIO; |
647 | 647 | ||