mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-03-06 19:51:13 +00:00
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>
This commit is contained in:
parent
1160d07656
commit
5cb4aeca8e
@ -146,7 +146,7 @@ static ssize_t lcd_read(struct file *file, char __user * buffer, size_t count, l
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int lcd_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
|
static long lcd_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||||
{
|
{
|
||||||
struct usb_lcd *dev;
|
struct usb_lcd *dev;
|
||||||
u16 bcdDevice;
|
u16 bcdDevice;
|
||||||
@ -158,12 +158,14 @@ static int lcd_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
|
|||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case IOCTL_GET_HARD_VERSION:
|
case IOCTL_GET_HARD_VERSION:
|
||||||
|
lock_kernel();
|
||||||
bcdDevice = le16_to_cpu((dev->udev)->descriptor.bcdDevice);
|
bcdDevice = le16_to_cpu((dev->udev)->descriptor.bcdDevice);
|
||||||
sprintf(buf,"%1d%1d.%1d%1d",
|
sprintf(buf,"%1d%1d.%1d%1d",
|
||||||
(bcdDevice & 0xF000)>>12,
|
(bcdDevice & 0xF000)>>12,
|
||||||
(bcdDevice & 0xF00)>>8,
|
(bcdDevice & 0xF00)>>8,
|
||||||
(bcdDevice & 0xF0)>>4,
|
(bcdDevice & 0xF0)>>4,
|
||||||
(bcdDevice & 0xF));
|
(bcdDevice & 0xF));
|
||||||
|
unlock_kernel();
|
||||||
if (copy_to_user((void __user *)arg,buf,strlen(buf))!=0)
|
if (copy_to_user((void __user *)arg,buf,strlen(buf))!=0)
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
break;
|
break;
|
||||||
@ -272,7 +274,7 @@ static const struct file_operations lcd_fops = {
|
|||||||
.read = lcd_read,
|
.read = lcd_read,
|
||||||
.write = lcd_write,
|
.write = lcd_write,
|
||||||
.open = lcd_open,
|
.open = lcd_open,
|
||||||
.ioctl = lcd_ioctl,
|
.unlocked_ioctl = lcd_ioctl,
|
||||||
.release = lcd_release,
|
.release = lcd_release,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user