From patchwork Fri Jan 4 20:59:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Devin Heitmueller X-Patchwork-Id: 1934721 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 67AA33FF0F for ; Fri, 4 Jan 2013 21:00:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755065Ab3ADVAF (ORCPT ); Fri, 4 Jan 2013 16:00:05 -0500 Received: from mail-vb0-f42.google.com ([209.85.212.42]:61821 "EHLO mail-vb0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754987Ab3ADVAA (ORCPT ); Fri, 4 Jan 2013 16:00:00 -0500 Received: by mail-vb0-f42.google.com with SMTP id fa15so16981651vbb.15 for ; Fri, 04 Jan 2013 12:59:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=xiIKjIp0twtltTRTfRe8FzZqtixbZpceEb10iq+t760=; b=Ikf7X2hipXdRCr2jG1u6hZOYXNDqhZmnTaai8IR9rgZyZlkGYXm47lB1hWDovg8LGg h5WOdSK54qAKgiL7bd0SYc8kLKjX6OD2DOiTWS2J36KQvFjVmLlMfz3nsPGtgcSAwBoM mDL6gdOU8K1BeK4oOvPG1YsJziNjSKWGE2oEeMHRNsF1dVz1DtnGpRLdpvOWc5/j8pNS 4AUDwO3QP+MrXN+N/tgAY2edEUUri37b4SapT1GKXJlZLW5Q6XukLFoPOWwvrC6I4jkk TwFJ3lMOECtu5wE9RxVZ2PZz/4SL+gAzviLhioVSDolKCpmhbRyGcIdpDU7eVkWF+ss4 9a4g== X-Received: by 10.220.157.9 with SMTP id z9mr77925366vcw.45.1357333199594; Fri, 04 Jan 2013 12:59:59 -0800 (PST) Received: from devin-ubuntu2.home (pool-108-54-72-165.nycmny.fios.verizon.net. [108.54.72.165]) by mx.google.com with ESMTPS id z20sm47278440vds.12.2013.01.04.12.59.58 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 04 Jan 2013 12:59:59 -0800 (PST) From: Devin Heitmueller To: linux-media@vger.kernel.org Cc: Devin Heitmueller , Hans Verkuil Subject: [PATCH 07/15] em28xx: convert to v4l2_fh, fix priority handling. Date: Fri, 4 Jan 2013 15:59:37 -0500 Message-Id: <1357333186-8466-8-git-send-email-dheitmueller@kernellabs.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1357333186-8466-1-git-send-email-dheitmueller@kernellabs.com> References: <1357333186-8466-1-git-send-email-dheitmueller@kernellabs.com> X-Gm-Message-State: ALoCoQn5lBKuBrOGVbqYm37B9zAutHAy/h2GOPAwsDkWzgAI2PjwDLlhGNdEP/st6AYHd1siq/6+ Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Signed-off-by: Hans Verkuil Signed-off-by: Devin Heitmueller --- drivers/media/usb/em28xx/em28xx-video.c | 5 +++++ drivers/media/usb/em28xx/em28xx.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c index ebbf775..c67ff8d 100644 --- a/drivers/media/usb/em28xx/em28xx-video.c +++ b/drivers/media/usb/em28xx/em28xx-video.c @@ -1735,6 +1735,7 @@ static int em28xx_v4l2_open(struct file *filp) mutex_unlock(&dev->lock); return -ENOMEM; } + v4l2_fh_init(&fh->fh, vdev); fh->dev = dev; fh->radio = radio; fh->type = fh_type; @@ -1774,6 +1775,7 @@ static int em28xx_v4l2_open(struct file *filp) V4L2_FIELD_SEQ_TB, sizeof(struct em28xx_buffer), fh, &dev->lock); mutex_unlock(&dev->lock); + v4l2_fh_add(&fh->fh); return errCode; } @@ -1867,6 +1869,8 @@ static int em28xx_v4l2_close(struct file *filp) "0 (error=%i)\n", errCode); } } + v4l2_fh_del(&fh->fh); + v4l2_fh_exit(&fh->fh); videobuf_mmap_free(&fh->vb_vidq); videobuf_mmap_free(&fh->vb_vbiq); @@ -2088,6 +2092,7 @@ static struct video_device *em28xx_vdev_init(struct em28xx *dev, vfd->release = video_device_release; vfd->debug = video_debug; vfd->lock = &dev->lock; + set_bit(V4L2_FL_USE_FH_PRIO, &vfd->flags); snprintf(vfd->name, sizeof(vfd->name), "%s %s", dev->name, type_name); diff --git a/drivers/media/usb/em28xx/em28xx.h b/drivers/media/usb/em28xx/em28xx.h index 707319e..7432be4 100644 --- a/drivers/media/usb/em28xx/em28xx.h +++ b/drivers/media/usb/em28xx/em28xx.h @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #if defined(CONFIG_VIDEO_EM28XX_DVB) || defined(CONFIG_VIDEO_EM28XX_DVB_MODULE) @@ -477,6 +478,7 @@ struct em28xx_audio { struct em28xx; struct em28xx_fh { + struct v4l2_fh fh; struct em28xx *dev; int radio; unsigned int resources;