diff options
author | Malcolm Priestley <tvboxspy@gmail.com> | 2011-04-16 13:30:32 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-05-20 09:28:53 -0300 |
commit | c8b7ced3460934cb31464463d7f909fef5db9391 (patch) | |
tree | bfb2634685f11169d0c4fb34b55366d4023e72f8 | |
parent | 6f030abf9a77f10213bc5a2da2eff478d4d4e0c3 (diff) | |
download | linux-3.10-c8b7ced3460934cb31464463d7f909fef5db9391.tar.gz linux-3.10-c8b7ced3460934cb31464463d7f909fef5db9391.tar.bz2 linux-3.10-c8b7ced3460934cb31464463d7f909fef5db9391.zip |
[media] dvb-usb return device errors to demuxer
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 <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | 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 df1ec3e69f4..965698b2d97 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; |