Commit a5ef91c9 authored by Dean Anderson's avatar Dean Anderson Committed by Mauro Carvalho Chehab

V4L/DVB: s2255drv: removal of big kernel lock

big kernel lock removed from open function.
v4l2 code does not require locking the open function except
to check asynchronous firmware load state, which is protected
by a mutex
Signed-off-by: default avatarDean Anderson <dean@sensoray.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent c0a2ec95
...@@ -1753,7 +1753,6 @@ static int s2255_open(struct file *file) ...@@ -1753,7 +1753,6 @@ static int s2255_open(struct file *file)
int state; int state;
dprintk(1, "s2255: open called (dev=%s)\n", dprintk(1, "s2255: open called (dev=%s)\n",
video_device_node_name(vdev)); video_device_node_name(vdev));
lock_kernel();
for (i = 0; i < MAX_CHANNELS; i++) for (i = 0; i < MAX_CHANNELS; i++)
if (&dev->vdev[i] == vdev) { if (&dev->vdev[i] == vdev) {
cur_channel = i; cur_channel = i;
...@@ -1769,7 +1768,6 @@ static int s2255_open(struct file *file) ...@@ -1769,7 +1768,6 @@ static int s2255_open(struct file *file)
switch (state) { switch (state) {
case S2255_FW_DISCONNECTING: case S2255_FW_DISCONNECTING:
mutex_unlock(&dev->open_lock); mutex_unlock(&dev->open_lock);
unlock_kernel();
return -ENODEV; return -ENODEV;
case S2255_FW_FAILED: case S2255_FW_FAILED:
s2255_dev_err(&dev->udev->dev, s2255_dev_err(&dev->udev->dev,
...@@ -1809,30 +1807,24 @@ static int s2255_open(struct file *file) ...@@ -1809,30 +1807,24 @@ static int s2255_open(struct file *file)
break; break;
case S2255_FW_FAILED: case S2255_FW_FAILED:
printk(KERN_INFO "2255 firmware load failed.\n"); printk(KERN_INFO "2255 firmware load failed.\n");
unlock_kernel();
return -ENODEV; return -ENODEV;
case S2255_FW_DISCONNECTING: case S2255_FW_DISCONNECTING:
printk(KERN_INFO "%s: disconnecting\n", __func__); printk(KERN_INFO "%s: disconnecting\n", __func__);
unlock_kernel();
return -ENODEV; return -ENODEV;
case S2255_FW_LOADED_DSPWAIT: case S2255_FW_LOADED_DSPWAIT:
case S2255_FW_NOTLOADED: case S2255_FW_NOTLOADED:
printk(KERN_INFO "%s: firmware not loaded yet" printk(KERN_INFO "%s: firmware not loaded yet"
"please try again later\n", "please try again later\n",
__func__); __func__);
unlock_kernel();
return -EAGAIN; return -EAGAIN;
default: default:
printk(KERN_INFO "%s: unknown state\n", __func__); printk(KERN_INFO "%s: unknown state\n", __func__);
unlock_kernel();
return -EFAULT; return -EFAULT;
} }
/* allocate + initialize per filehandle data */ /* allocate + initialize per filehandle data */
fh = kzalloc(sizeof(*fh), GFP_KERNEL); fh = kzalloc(sizeof(*fh), GFP_KERNEL);
if (NULL == fh) { if (NULL == fh)
unlock_kernel();
return -ENOMEM; return -ENOMEM;
}
file->private_data = fh; file->private_data = fh;
fh->dev = dev; fh->dev = dev;
fh->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; fh->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
...@@ -1860,7 +1852,6 @@ static int s2255_open(struct file *file) ...@@ -1860,7 +1852,6 @@ static int s2255_open(struct file *file)
fh->type, fh->type,
V4L2_FIELD_INTERLACED, V4L2_FIELD_INTERLACED,
sizeof(struct s2255_buffer), fh); sizeof(struct s2255_buffer), fh);
unlock_kernel();
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment