From patchwork Mon Oct 4 19:32:05 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 230041 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o94JWDvg006227 for ; Mon, 4 Oct 2010 19:32:14 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932112Ab0JDTcL (ORCPT ); Mon, 4 Oct 2010 15:32:11 -0400 Received: from moutng.kundenserver.de ([212.227.126.186]:63335 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752126Ab0JDTcL (ORCPT ); Mon, 4 Oct 2010 15:32:11 -0400 Received: from wuerfel.localnet (port-92-200-90-25.dynamic.qsc.de [92.200.90.25]) by mrelayeu.kundenserver.de (node=mreu0) with ESMTP (Nemesis) id 0MKMjK-1P3Ozp2RmA-001erm; Mon, 04 Oct 2010 21:32:07 +0200 From: Arnd Bergmann To: Mauro Carvalho Chehab Subject: [PATCH] dabusb: remove the BKL Date: Mon, 4 Oct 2010 21:32:05 +0200 User-Agent: KMail/1.13.5 (Linux/2.6.31-19-generic; KDE/4.5.1; x86_64; ; ) Cc: linux-media@vger.kernel.org MIME-Version: 1.0 Message-Id: <201010042132.05292.arnd@arndb.de> X-Provags-ID: V02:K0:mwZl7pcTfXA25g7TNZs8YqpzIS6vundnkrr9IAamzHO sK1ZAnFg7k+htRMA5oqO8olinZ7GRPAJm65VH4sqziVyY3rimM POlHxYiZVqwT5HLvYcyQVvvQumNaoV4/Zu6j0pJ3I64oyuKCxT wnwU5epkGZ6En0pmsVV0pIgohL22NOKUuQn16mnxbC1Hf1pZ+S AS1ro51X4MFZvkg2QTrGg== 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 (demeter1.kernel.org [140.211.167.41]); Mon, 04 Oct 2010 19:32:15 +0000 (UTC) diff --git a/drivers/media/video/dabusb.c b/drivers/media/video/dabusb.c index 5b176bd..f3e25e9 100644 --- a/drivers/media/video/dabusb.c +++ b/drivers/media/video/dabusb.c @@ -32,7 +32,6 @@ #include #include #include -#include #include #include #include @@ -621,7 +620,6 @@ static int dabusb_open (struct inode *inode, struct file *file) if (devnum < DABUSB_MINOR || devnum >= (DABUSB_MINOR + NRDABUSB)) return -EIO; - lock_kernel(); s = &dabusb[devnum - DABUSB_MINOR]; dbg("dabusb_open"); @@ -630,21 +628,17 @@ static int dabusb_open (struct inode *inode, struct file *file) while (!s->usbdev || s->opened) { mutex_unlock(&s->mutex); - if (file->f_flags & O_NONBLOCK) { + if (file->f_flags & O_NONBLOCK) return -EBUSY; - } msleep_interruptible(500); - if (signal_pending (current)) { - unlock_kernel(); + if (signal_pending (current)) return -EAGAIN; - } mutex_lock(&s->mutex); } if (usb_set_interface (s->usbdev, _DABUSB_IF, 1) < 0) { mutex_unlock(&s->mutex); dev_err(&s->usbdev->dev, "set_interface failed\n"); - unlock_kernel(); return -EINVAL; } s->opened = 1; @@ -654,7 +648,6 @@ static int dabusb_open (struct inode *inode, struct file *file) file->private_data = s; r = nonseekable_open(inode, file); - unlock_kernel(); return r; } @@ -689,17 +682,13 @@ static long dabusb_ioctl (struct file *file, unsigned int cmd, unsigned long arg dbg("dabusb_ioctl"); - lock_kernel(); - if (s->remove_pending) { - unlock_kernel(); + if (s->remove_pending) return -EIO; - } mutex_lock(&s->mutex); if (!s->usbdev) { mutex_unlock(&s->mutex); - unlock_kernel(); return -EIO; } @@ -735,7 +724,6 @@ static long dabusb_ioctl (struct file *file, unsigned int cmd, unsigned long arg break; } mutex_unlock(&s->mutex); - unlock_kernel(); return ret; }