From patchwork Mon Jan 3 18:31:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 448801 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 p03IVXZJ026395 for ; Mon, 3 Jan 2011 18:31:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754127Ab1ACSbd (ORCPT ); Mon, 3 Jan 2011 13:31:33 -0500 Received: from smtp-vbr18.xs4all.nl ([194.109.24.38]:3739 "EHLO smtp-vbr18.xs4all.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753974Ab1ACSbc (ORCPT ); Mon, 3 Jan 2011 13:31:32 -0500 Received: from localhost.localdomain (43.80-203-71.nextgentel.com [80.203.71.43]) (authenticated bits=0) by smtp-vbr18.xs4all.nl (8.13.8/8.13.8) with ESMTP id p03IVMuZ006180 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 3 Jan 2011 19:31:31 +0100 (CET) (envelope-from hverkuil@xs4all.nl) From: Hans Verkuil To: linux-media@vger.kernel.org Subject: [RFCv2 PATCH 08/10] radio-cadet: use v4l2_fh helper functions Date: Mon, 3 Jan 2011 19:31:13 +0100 Message-Id: <362367dfefbbed04a99e28acedf68b8c28f820a6.1294078230.git.hverkuil@xs4all.nl> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1294079475-13259-1-git-send-email-hverkuil@xs4all.nl> References: <1294079475-13259-1-git-send-email-hverkuil@xs4all.nl> In-Reply-To: <6515cfbdde63364fd12bca1219870f38ff371145.1294078230.git.hverkuil@xs4all.nl> References: <6515cfbdde63364fd12bca1219870f38ff371145.1294078230.git.hverkuil@xs4all.nl> X-Virus-Scanned: by XS4ALL Virus Scanner 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, 03 Jan 2011 18:31:37 +0000 (UTC) diff --git a/drivers/media/radio/radio-cadet.c b/drivers/media/radio/radio-cadet.c index bc9ad08..9dbbb41 100644 --- a/drivers/media/radio/radio-cadet.c +++ b/drivers/media/radio/radio-cadet.c @@ -42,6 +42,7 @@ #include /* outb, outb_p */ #include #include +#include MODULE_AUTHOR("Fred Gleason, Russell Kroll, Quay Lu, Donald Song, Jason Lewis, Scott McGrath, William McGrath"); MODULE_DESCRIPTION("A driver for the ADS Cadet AM/FM/RDS radio card."); @@ -526,7 +527,10 @@ static int vidioc_s_audio(struct file *file, void *priv, static int cadet_open(struct file *file) { struct cadet *dev = video_drvdata(file); + int ret = v4l2_fh_open(file); + if (ret) + return ret; mutex_lock(&dev->lock); dev->users++; if (1 == dev->users) @@ -546,7 +550,7 @@ static int cadet_release(struct file *file) dev->rdsstat = 0; } mutex_unlock(&dev->lock); - return 0; + return v4l2_fh_release(file); } static unsigned int cadet_poll(struct file *file, struct poll_table_struct *wait)