diff options
author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2008-05-22 17:07:51 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-07-21 18:16:18 -0400 |
commit | 5cb4aeca8e8c29605703be5576825eb3257d8a92 (patch) | |
tree | b33bd1668d65836c6f6ceb2d60ea75de0a664728 /drivers/usb/misc | |
parent | 1160d0765660e14b44dffd931b28a3875d5d9e46 (diff) |
USB: usblcd: Push down BKL into driver
I'm pretty sure this can be eliminated however I couldn't prove (or find)
what stopped the device vanishing mid IOCTL_GET_HARD_VERSION. Perhaps a
USB wizard could double check that and see if the lock_kernel can go
entirely.
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/misc')
-rw-r--r-- | drivers/usb/misc/usblcd.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/usb/misc/usblcd.c b/drivers/usb/misc/usblcd.c index 7f7021ee4189..2db4228fbb01 100644 --- a/drivers/usb/misc/usblcd.c +++ b/drivers/usb/misc/usblcd.c | |||
@@ -146,7 +146,7 @@ static ssize_t lcd_read(struct file *file, char __user * buffer, size_t count, l | |||
146 | return retval; | 146 | return retval; |
147 | } | 147 | } |
148 | 148 | ||
149 | static int lcd_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) | 149 | static long lcd_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
150 | { | 150 | { |
151 | struct usb_lcd *dev; | 151 | struct usb_lcd *dev; |
152 | u16 bcdDevice; | 152 | u16 bcdDevice; |
@@ -158,12 +158,14 @@ static int lcd_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u | |||
158 | 158 | ||
159 | switch (cmd) { | 159 | switch (cmd) { |
160 | case IOCTL_GET_HARD_VERSION: | 160 | case IOCTL_GET_HARD_VERSION: |
161 | lock_kernel(); | ||
161 | bcdDevice = le16_to_cpu((dev->udev)->descriptor.bcdDevice); | 162 | bcdDevice = le16_to_cpu((dev->udev)->descriptor.bcdDevice); |
162 | sprintf(buf,"%1d%1d.%1d%1d", | 163 | sprintf(buf,"%1d%1d.%1d%1d", |
163 | (bcdDevice & 0xF000)>>12, | 164 | (bcdDevice & 0xF000)>>12, |
164 | (bcdDevice & 0xF00)>>8, | 165 | (bcdDevice & 0xF00)>>8, |
165 | (bcdDevice & 0xF0)>>4, | 166 | (bcdDevice & 0xF0)>>4, |
166 | (bcdDevice & 0xF)); | 167 | (bcdDevice & 0xF)); |
168 | unlock_kernel(); | ||
167 | if (copy_to_user((void __user *)arg,buf,strlen(buf))!=0) | 169 | if (copy_to_user((void __user *)arg,buf,strlen(buf))!=0) |
168 | return -EFAULT; | 170 | return -EFAULT; |
169 | break; | 171 | break; |
@@ -272,7 +274,7 @@ static const struct file_operations lcd_fops = { | |||
272 | .read = lcd_read, | 274 | .read = lcd_read, |
273 | .write = lcd_write, | 275 | .write = lcd_write, |
274 | .open = lcd_open, | 276 | .open = lcd_open, |
275 | .ioctl = lcd_ioctl, | 277 | .unlocked_ioctl = lcd_ioctl, |
276 | .release = lcd_release, | 278 | .release = lcd_release, |
277 | }; | 279 | }; |
278 | 280 | ||