]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
[media] dvb_usb_v2: call streaming_ctrl() before kill urbs
authorAntti Palosaari <crope@iki.fi>
Tue, 11 Sep 2012 01:04:43 +0000 (22:04 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 27 Sep 2012 18:14:08 +0000 (15:14 -0300)
Logically it is better ask hardware to stop streaming before
killing urbs carrying stream. Earlier it was just opposite.
Now code runs:
* submit urbs
* start streaming
** streaming ongoing **
* stop streaming
* kill urbs

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/usb/dvb-usb-v2/dvb_usb_core.c

index e2d73e1a7ae035aa2d5c7c012b320cf0b2cacbbd..f990159379571204f01dfbb9a840002ab8557c37 100644 (file)
@@ -265,7 +265,6 @@ static inline int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed,
        /* stop feeding if it is last pid */
        if (adap->feed_count == 0) {
                dev_dbg(&d->udev->dev, "%s: stop feeding\n", __func__);
-               usb_urb_killv2(&adap->stream);
 
                if (d->props->streaming_ctrl) {
                        ret = d->props->streaming_ctrl(
@@ -274,9 +273,11 @@ static inline int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed,
                                dev_err(&d->udev->dev, "%s: streaming_ctrl() " \
                                                "failed=%d\n", KBUILD_MODNAME,
                                                ret);
+                               usb_urb_killv2(&adap->stream);
                                goto err_mutex_unlock;
                        }
                }
+               usb_urb_killv2(&adap->stream);
                mutex_unlock(&adap->sync_mutex);
        }