Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab...
[linux.git] / drivers / staging / media / msi3101 / sdr-msi3101.c
index 260d1b7367212637a70e79ed4628f2025777b263..65d351f99da2e48607d3f8e1c0d6ff84ba8af17f 100644 (file)
@@ -913,7 +913,6 @@ static int msi3101_set_usb_adc(struct msi3101_state *s)
 
        /* set tuner, subdev, filters according to sampling rate */
        bandwidth_auto = v4l2_ctrl_find(&s->hdl, V4L2_CID_RF_TUNER_BANDWIDTH_AUTO);
-       bandwidth = v4l2_ctrl_find(&s->hdl, V4L2_CID_RF_TUNER_BANDWIDTH);
        if (v4l2_ctrl_g_ctrl(bandwidth_auto)) {
                bandwidth = v4l2_ctrl_find(&s->hdl, V4L2_CID_RF_TUNER_BANDWIDTH);
                v4l2_ctrl_s_ctrl(bandwidth, s->f_adc);
@@ -1078,6 +1077,7 @@ static int msi3101_start_streaming(struct vb2_queue *vq, unsigned int count)
 static int msi3101_stop_streaming(struct vb2_queue *vq)
 {
        struct msi3101_state *s = vb2_get_drv_priv(vq);
+       int ret;
        dev_dbg(&s->udev->dev, "%s:\n", __func__);
 
        if (mutex_lock_interruptible(&s->v4l2_lock))
@@ -1090,17 +1090,22 @@ static int msi3101_stop_streaming(struct vb2_queue *vq)
 
        /* according to tests, at least 700us delay is required  */
        msleep(20);
-       msi3101_ctrl_msg(s, CMD_STOP_STREAMING, 0);
+       ret = msi3101_ctrl_msg(s, CMD_STOP_STREAMING, 0);
+       if (ret)
+               goto err_sleep_tuner;
 
        /* sleep USB IF / ADC */
-       msi3101_ctrl_msg(s, CMD_WREG, 0x01000003);
+       ret = msi3101_ctrl_msg(s, CMD_WREG, 0x01000003);
+       if (ret)
+               goto err_sleep_tuner;
 
+err_sleep_tuner:
        /* sleep tuner */
-       v4l2_subdev_call(s->v4l2_subdev, core, s_power, 0);
+       ret = v4l2_subdev_call(s->v4l2_subdev, core, s_power, 0);
 
        mutex_unlock(&s->v4l2_lock);
 
-       return 0;
+       return ret;
 }
 
 static struct vb2_ops msi3101_vb2_ops = {