From patchwork Tue Sep 22 17:19:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 7241601 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 413A89F443 for ; Tue, 22 Sep 2015 17:24:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 681AD209EB for ; Tue, 22 Sep 2015 17:24:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7D531209C3 for ; Tue, 22 Sep 2015 17:24:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758297AbbIVRYu (ORCPT ); Tue, 22 Sep 2015 13:24:50 -0400 Received: from resqmta-po-07v.sys.comcast.net ([96.114.154.166]:33282 "EHLO resqmta-po-07v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752171AbbIVRYt (ORCPT ); Tue, 22 Sep 2015 13:24:49 -0400 X-Greylist: delayed 300 seconds by postgrey-1.27 at vger.kernel.org; Tue, 22 Sep 2015 13:24:49 EDT Received: from resomta-po-06v.sys.comcast.net ([96.114.154.230]) by resqmta-po-07v.sys.comcast.net with comcast id LHJW1r0044yXVJQ01HL0k6; Tue, 22 Sep 2015 17:20:00 +0000 Received: from mail.gonehiking.org ([73.181.52.62]) by resomta-po-06v.sys.comcast.net with comcast id LHKz1r0061LXgTt01HKz6o; Tue, 22 Sep 2015 17:20:00 +0000 Received: from lorien.internal (lorien-wl.internal [192.168.1.40]) by mail.gonehiking.org (Postfix) with ESMTP id EBD5EA153E; Tue, 22 Sep 2015 11:19:58 -0600 (MDT) From: Shuah Khan To: mchehab@osg.samsung.com, hans.verkuil@cisco.com, laurent.pinchart@ideasonboard.com, sakari.ailus@linux.intel.com, tiwai@suse.de, pawel@osciak.com, m.szyprowski@samsung.com, kyungmin.park@samsung.com, perex@perex.cz, stefanr@s5r6.in-berlin.de, crope@iki.fi, dan.carpenter@oracle.com, tskd08@gmail.com, ruchandani.tina@gmail.com, arnd@arndb.de, chehabrafael@gmail.com, prabhakar.csengg@gmail.com, Julia.Lawall@lip6.fr, elfring@users.sourceforge.net, ricardo.ribalda@gmail.com, chris.j.arges@canonical.com, pierre-louis.bossart@linux.intel.com, gtmkramer@xs4all.nl, clemens@ladisch.de, misterpib@gmail.com, takamichiho@gmail.com, pmatilai@laiskiainen.org, damien@zamaudio.com, daniel@zonque.org, vladcatoi@gmail.com, normalperson@yhbt.net, joe@oampo.co.uk, bugzilla.frnkcg@spamgourmet.com, jussi@sonarnerd.net Cc: Shuah Khan , linux-media@vger.kernel.org, alsa-devel@alsa-project.org Subject: [PATCH v3 20/21] media: media: dvb-frontend fix enable_source error legs Date: Tue, 22 Sep 2015 11:19:39 -0600 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1442942400; bh=YoNn79wEDnj28LWxzv1hEYx3v1mevAfMjYG6VWh2CCU=; h=Received:Received:Received:From:To:Subject:Date:Message-Id; b=Bv/wmYh2cvPEMav8UwIoYHJ8nl328UNMb60/4O71Q466yPBDYBaMimKduqDqgG21g X+mX40V+w6grQk8Mv6WpzZpxq+O3D06+1CCwGdchCGR1aPlvrkT7MGSqRUXOJ13F3z BIsC+NYDORazm9BsO3TF4gWvvMmVTQuY0U2+NyOO7aX+ZMHM652c1py6X3vvAPpAe0 I2qMMbmNJIip/DL/VSWtaXcjOk8qIwsJUcAE1gTL4SbK31cQwmPM7WknRAckSyesXG sA7wOz+JaBaDrGjoQ2Xv+AlBT4kTV9gcBgUUT5uksO2kWbZWJj2KJbKlmHVzLw9Mbq nJyr04RGAiU5g== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When enable_source finds the tuner busy, do dvb_generic_release(). In addition, when dvb_frontend_start() fails, call disable_source to release tuner. Signed-off-by: Shuah Khan --- drivers/media/dvb-core/dvb_frontend.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/media/dvb-core/dvb_frontend.c b/drivers/media/dvb-core/dvb_frontend.c index c06dd61..67e30ae 100644 --- a/drivers/media/dvb-core/dvb_frontend.c +++ b/drivers/media/dvb-core/dvb_frontend.c @@ -2503,13 +2503,13 @@ static int dvb_frontend_open(struct inode *inode, struct file *file) if (ret) { dev_err(fe->dvb->device, "Tuner is busy. Error %d\n", ret); - goto err1; + goto err2; } } #endif ret = dvb_frontend_start (fe); if (ret) - goto err2; + goto err3; /* empty event queue */ fepriv->events.eventr = fepriv->events.eventw = 0; @@ -2519,6 +2519,11 @@ static int dvb_frontend_open(struct inode *inode, struct file *file) mutex_unlock (&adapter->mfe_lock); return ret; +err3: +#ifdef CONFIG_MEDIA_CONTROLLER_DVB + if (fe->dvb->mdev && fe->dvb->mdev->disable_source) + fe->dvb->mdev->disable_source(dvbdev->entity); +#endif err2: dvb_generic_release(inode, file); err1: