aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/s2255drv.c
diff options
context:
space:
mode:
authorDean Anderson <dean@sensoray.com>2010-04-08 22:46:08 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-05-19 11:57:23 -0400
commita5ef91c9a55c89e8c57e628d371107cdfe2d0bd9 (patch)
tree9e48cde53711ce1c8f56bf43477cdb518527ca84 /drivers/media/video/s2255drv.c
parentc0a2ec956d6e61081b6f98b839b0e28979941687 (diff)
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: Dean Anderson <dean@sensoray.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/s2255drv.c')
-rw-r--r--drivers/media/video/s2255drv.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/media/video/s2255drv.c b/drivers/media/video/s2255drv.c
index 4c5d3672e2db..83ee93d4ad1c 100644
--- a/drivers/media/video/s2255drv.c
+++ b/drivers/media/video/s2255drv.c
@@ -1753,7 +1753,6 @@ static int s2255_open(struct file *file)
1753 int state; 1753 int state;
1754 dprintk(1, "s2255: open called (dev=%s)\n", 1754 dprintk(1, "s2255: open called (dev=%s)\n",
1755 video_device_node_name(vdev)); 1755 video_device_node_name(vdev));
1756 lock_kernel();
1757 for (i = 0; i < MAX_CHANNELS; i++) 1756 for (i = 0; i < MAX_CHANNELS; i++)
1758 if (&dev->vdev[i] == vdev) { 1757 if (&dev->vdev[i] == vdev) {
1759 cur_channel = i; 1758 cur_channel = i;
@@ -1769,7 +1768,6 @@ static int s2255_open(struct file *file)
1769 switch (state) { 1768 switch (state) {
1770 case S2255_FW_DISCONNECTING: 1769 case S2255_FW_DISCONNECTING:
1771 mutex_unlock(&dev->open_lock); 1770 mutex_unlock(&dev->open_lock);
1772 unlock_kernel();
1773 return -ENODEV; 1771 return -ENODEV;
1774 case S2255_FW_FAILED: 1772 case S2255_FW_FAILED:
1775 s2255_dev_err(&dev->udev->dev, 1773 s2255_dev_err(&dev->udev->dev,
@@ -1809,30 +1807,24 @@ static int s2255_open(struct file *file)
1809 break; 1807 break;
1810 case S2255_FW_FAILED: 1808 case S2255_FW_FAILED:
1811 printk(KERN_INFO "2255 firmware load failed.\n"); 1809 printk(KERN_INFO "2255 firmware load failed.\n");
1812 unlock_kernel();
1813 return -ENODEV; 1810 return -ENODEV;
1814 case S2255_FW_DISCONNECTING: 1811 case S2255_FW_DISCONNECTING:
1815 printk(KERN_INFO "%s: disconnecting\n", __func__); 1812 printk(KERN_INFO "%s: disconnecting\n", __func__);
1816 unlock_kernel();
1817 return -ENODEV; 1813 return -ENODEV;
1818 case S2255_FW_LOADED_DSPWAIT: 1814 case S2255_FW_LOADED_DSPWAIT:
1819 case S2255_FW_NOTLOADED: 1815 case S2255_FW_NOTLOADED:
1820 printk(KERN_INFO "%s: firmware not loaded yet" 1816 printk(KERN_INFO "%s: firmware not loaded yet"
1821 "please try again later\n", 1817 "please try again later\n",
1822 __func__); 1818 __func__);
1823 unlock_kernel();
1824 return -EAGAIN; 1819 return -EAGAIN;
1825 default: 1820 default:
1826 printk(KERN_INFO "%s: unknown state\n", __func__); 1821 printk(KERN_INFO "%s: unknown state\n", __func__);
1827 unlock_kernel();
1828 return -EFAULT; 1822 return -EFAULT;
1829 } 1823 }
1830 /* allocate + initialize per filehandle data */ 1824 /* allocate + initialize per filehandle data */
1831 fh = kzalloc(sizeof(*fh), GFP_KERNEL); 1825 fh = kzalloc(sizeof(*fh), GFP_KERNEL);
1832 if (NULL == fh) { 1826 if (NULL == fh)
1833 unlock_kernel();
1834 return -ENOMEM; 1827 return -ENOMEM;
1835 }
1836 file->private_data = fh; 1828 file->private_data = fh;
1837 fh->dev = dev; 1829 fh->dev = dev;
1838 fh->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 1830 fh->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
@@ -1860,7 +1852,6 @@ static int s2255_open(struct file *file)
1860 fh->type, 1852 fh->type,
1861 V4L2_FIELD_INTERLACED, 1853 V4L2_FIELD_INTERLACED,
1862 sizeof(struct s2255_buffer), fh); 1854 sizeof(struct s2255_buffer), fh);
1863 unlock_kernel();
1864 return 0; 1855 return 0;
1865} 1856}
1866 1857