From patchwork Sun Apr 17 19:55:14 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 713651 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 p3HJtZhE015992 for ; Sun, 17 Apr 2011 19:55:38 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751511Ab1DQTzX (ORCPT ); Sun, 17 Apr 2011 15:55:23 -0400 Received: from mail-ww0-f44.google.com ([74.125.82.44]:40641 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750942Ab1DQTzW (ORCPT ); Sun, 17 Apr 2011 15:55:22 -0400 Received: by wwa36 with SMTP id 36so4886175wwa.1 for ; Sun, 17 Apr 2011 12:55:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:subject:from:to:content-type:date:message-id :mime-version:x-mailer:content-transfer-encoding; bh=zCpXbEviFkbG0cVbqRpsYYPltPIIFiVtSjJaz8Z6ZFA=; b=ayUjjdSOnSktbI0JBihIqLifWMEbVFPi/XZtQXmYAxUBUH/PH4t2SyUGiK9Uin7RlM rd8ojur5kHiy4dyJ4qCEtrEo+azp9dN85VzjfFGU87ttJVIP3CAOG3d7mMTE2Jzh1D1o Eo1nxP+wqeerhObXRnFczCCABgeixqy11evSI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; b=Wnz7BG+3la6oi0rAR1qrT7YBaKlamaF4VNWe8SOkADgfLAG1rZgQkPXlqGfqGB2Ot7 zDDm0IOUD/UAa7MIHL3mUshsmrPQG4yv0AlvWW8l3C70CasOLCTMWGFVD+XwS+se2h0L hp9HAp5wzcO/iCZwfbbfh0YwCPiTXpLRDiwHg= Received: by 10.227.20.13 with SMTP id d13mr4184039wbb.133.1303070121250; Sun, 17 Apr 2011 12:55:21 -0700 (PDT) Received: from [10.64.64.65] (92.41.251.230.threembb.co.uk [92.41.251.230]) by mx.google.com with ESMTPS id h11sm2846987wbc.9.2011.04.17.12.55.19 (version=SSLv3 cipher=OTHER); Sun, 17 Apr 2011 12:55:20 -0700 (PDT) Subject: [PATCH] dvb-usb return device errors to demuxer v2. From: Malcolm Priestley To: linux-media@vger.kernel.org Date: Sun, 17 Apr 2011 20:55:14 +0100 Message-ID: <1303070114.2104.2.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.32.2 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.6 (demeter1.kernel.org [140.211.167.41]); Sun, 17 Apr 2011 19:55:38 +0000 (UTC) Return device errors to demuxer from on/off streamming and pid filtering. Replaces earlier patch that gave false error on stream stopping. Please test this patch with all dvb-usb devices. Signed-off-by: Malcolm Priestley --- drivers/media/dvb/dvb-usb/dvb-usb-dvb.c | 31 +++++++++++++++++++++---------- 1 files changed, 21 insertions(+), 10 deletions(-) diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c b/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c index df1ec3e..b3cb626 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c +++ b/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c @@ -12,7 +12,7 @@ static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff) { struct dvb_usb_adapter *adap = dvbdmxfeed->demux->priv; - int newfeedcount,ret; + int newfeedcount, ret; if (adap == NULL) return -ENODEV; @@ -24,9 +24,13 @@ static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff) deb_ts("stop feeding\n"); usb_urb_kill(&adap->stream); - if (adap->props.streaming_ctrl != NULL) - if ((ret = adap->props.streaming_ctrl(adap,0))) + if (adap->props.streaming_ctrl != NULL) { + ret = adap->props.streaming_ctrl(adap, 0); + if (ret < 0) { err("error while stopping stream."); + return ret; + } + } } adap->feedcount = newfeedcount; @@ -49,17 +53,24 @@ static int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff) deb_ts("controlling pid parser\n"); if (adap->props.caps & DVB_USB_ADAP_HAS_PID_FILTER && - adap->props.caps & DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF && - adap->props.pid_filter_ctrl != NULL) - if (adap->props.pid_filter_ctrl(adap,adap->pid_filtering) < 0) + adap->props.caps & + DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF && + adap->props.pid_filter_ctrl != NULL) { + ret = adap->props.pid_filter_ctrl(adap, + adap->pid_filtering); + if (ret < 0) { err("could not handle pid_parser"); - + return ret; + } + } deb_ts("start feeding\n"); - if (adap->props.streaming_ctrl != NULL) - if (adap->props.streaming_ctrl(adap,1)) { + if (adap->props.streaming_ctrl != NULL) { + ret = adap->props.streaming_ctrl(adap, 1); + if (ret < 0) { err("error while enabling fifo."); - return -ENODEV; + return ret; } + } } return 0;