From patchwork Wed Mar 31 14:41:51 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dean Anderson X-Patchwork-Id: 89958 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2VEfvSU010016 for ; Wed, 31 Mar 2010 14:41:57 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756022Ab0CaOly (ORCPT ); Wed, 31 Mar 2010 10:41:54 -0400 Received: from gateway08.websitewelcome.com ([69.56.159.17]:46922 "HELO gateway08.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1755962Ab0CaOly (ORCPT ); Wed, 31 Mar 2010 10:41:54 -0400 Received: (qmail 2030 invoked from network); 31 Mar 2010 14:43:11 -0000 Received: from gator886.hostgator.com (174.120.40.226) by gateway08.websitewelcome.com with SMTP; 31 Mar 2010 14:43:11 -0000 Received: from [66.15.212.169] (port=25690 helo=user-desktop.local) by gator886.hostgator.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1Nwz7D-00041i-27; Wed, 31 Mar 2010 09:41:55 -0500 Date: Wed, 31 Mar 2010 07:41:51 -0700 (PDT) From: "Dean A." Subject: [PATCH] s2255drv: removal of big kernel lock To: linux-media@vger.kernel.org Message-ID: MIME-Version: 1.0 Content-Disposition: INLINE X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator886.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - sensoray.com Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 31 Mar 2010 14:42:06 +0000 (UTC) diff -r 2ab296deae93 -r c72bdc8732ab linux/drivers/media/video/s2255drv.c --- a/linux/drivers/media/video/s2255drv.c Wed Mar 31 07:30:56 2010 -0700 +++ b/linux/drivers/media/video/s2255drv.c Wed Mar 31 07:38:11 2010 -0700 @@ -1753,7 +1753,6 @@ int state; dprintk(1, "s2255: open called (dev=%s)\n", video_device_node_name(vdev)); - lock_kernel(); for (i = 0; i < MAX_CHANNELS; i++) if (&dev->vdev[i] == vdev) { cur_channel = i; @@ -1769,7 +1768,6 @@ switch (state) { case S2255_FW_DISCONNECTING: mutex_unlock(&dev->open_lock); - unlock_kernel(); return -ENODEV; case S2255_FW_FAILED: s2255_dev_err(&dev->udev->dev, @@ -1809,30 +1807,24 @@ break; case S2255_FW_FAILED: printk(KERN_INFO "2255 firmware load failed.\n"); - unlock_kernel(); return -ENODEV; case S2255_FW_DISCONNECTING: printk(KERN_INFO "%s: disconnecting\n", __func__); - unlock_kernel(); return -ENODEV; case S2255_FW_LOADED_DSPWAIT: case S2255_FW_NOTLOADED: printk(KERN_INFO "%s: firmware not loaded yet" "please try again later\n", __func__); - unlock_kernel(); return -EAGAIN; default: printk(KERN_INFO "%s: unknown state\n", __func__); - unlock_kernel(); return -EFAULT; } /* allocate + initialize per filehandle data */ fh = kzalloc(sizeof(*fh), GFP_KERNEL); - if (NULL == fh) { - unlock_kernel(); + if (NULL == fh) return -ENOMEM; - } file->private_data = fh; fh->dev = dev; fh->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; @@ -1860,7 +1852,6 @@ fh->type, V4L2_FIELD_INTERLACED, sizeof(struct s2255_buffer), fh); - unlock_kernel(); return 0; }