From patchwork Sat Apr 16 16:30:32 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 712711 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 p3GGUgAX021278 for ; Sat, 16 Apr 2011 16:30:42 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755942Ab1DPQak (ORCPT ); Sat, 16 Apr 2011 12:30:40 -0400 Received: from mail-ww0-f42.google.com ([74.125.82.42]:56905 "EHLO mail-ww0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751667Ab1DPQak (ORCPT ); Sat, 16 Apr 2011 12:30:40 -0400 Received: by wwk4 with SMTP id 4so526100wwk.1 for ; Sat, 16 Apr 2011 09:30:39 -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=owRQvYe3vR78dmLUM7UiGF5+07FE+Jwg6bzL5vELOTA=; b=VoUasyreIvV1EkeQB69u0rFCpBZvTF717rgVWq5x82yAQVNf9Z5rpHTXpPAFbrPvaG i7n6fBu1qJUrQVxOB7OFdEY5h/i7LE5UESNPjVxQmayFhXNJSwgJ3KtYXEO4MARRi0uh Fs5zVRwcDCxz07vGAu3kENtSHHjY+N/c6Effo= 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=JZvmwwb3mwSMrCIViJHiPo6MmFQRG903qxk3pC185fsuSdor1pGqA58KUvTOTyaGUd vffe2oX8ZXWnywwUf6N2PlA0hm+2VUTzT+0fYa4YTjg2DFx8/KrH0UBH3uHyvOHqo5uk +zBoLuwN0E4ji0ovozNGlYRUCqgBKWyer+GLQ= Received: by 10.216.166.207 with SMTP id g57mr722634wel.111.1302971439048; Sat, 16 Apr 2011 09:30:39 -0700 (PDT) Received: from [10.64.64.65] (94.197.127.231.threembb.co.uk [94.197.127.231]) by mx.google.com with ESMTPS id g32sm1799667wej.27.2011.04.16.09.30.36 (version=SSLv3 cipher=OTHER); Sat, 16 Apr 2011 09:30:38 -0700 (PDT) Subject: [PATCH] dvb-usb return device errors to demuxer. From: Malcolm Priestley To: linux-media@vger.kernel.org Date: Sat, 16 Apr 2011 17:30:32 +0100 Message-ID: <1302971432.3068.4.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]); Sat, 16 Apr 2011 16:31:22 +0000 (UTC) Return device errors to demuxer from on/off streamming and pid filtering. Please test this patch with all dvb-usb devices. Signed-off-by: Malcolm Priestley --- drivers/media/dvb/dvb-usb/dvb-usb-dvb.c | 32 ++++++++++++++++++++---------- 1 files changed, 21 insertions(+), 11 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..965698b 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,12 @@ 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))) - err("error while stopping stream."); + if (adap->props.streaming_ctrl != NULL) { + ret = adap->props.streaming_ctrl(adap, 0); + err("error while stopping stream."); + if (ret < 0) + return ret; + } } adap->feedcount = newfeedcount; @@ -49,17 +52,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;