These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / media / usb / cx231xx / cx231xx-video.c
index c261e16..d0d8f08 100644 (file)
@@ -749,8 +749,7 @@ static void free_buffer(struct videobuf_queue *vq, struct cx231xx_buffer *buf)
        struct cx231xx *dev = fh->dev;
        unsigned long flags = 0;
 
-       if (in_interrupt())
-               BUG();
+       BUG_ON(in_interrupt());
 
        /* We used to wait for the buffer to finish here, but this didn't work
           because, as we were keeping the state as VIDEOBUF_QUEUED,
@@ -1013,7 +1012,9 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
        struct cx231xx *dev = fh->dev;
        int rc;
        struct cx231xx_fmt *fmt;
-       struct v4l2_mbus_framefmt mbus_fmt;
+       struct v4l2_subdev_format format = {
+               .which = V4L2_SUBDEV_FORMAT_ACTIVE,
+       };
 
        rc = check_dev(dev);
        if (rc < 0)
@@ -1041,9 +1042,9 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
        dev->height = f->fmt.pix.height;
        dev->format = fmt;
 
-       v4l2_fill_mbus_format(&mbus_fmt, &f->fmt.pix, MEDIA_BUS_FMT_FIXED);
-       call_all(dev, video, s_mbus_fmt, &mbus_fmt);
-       v4l2_fill_pix_format(&f->fmt.pix, &mbus_fmt);
+       v4l2_fill_mbus_format(&format.format, &f->fmt.pix, MEDIA_BUS_FMT_FIXED);
+       call_all(dev, pad, set_fmt, NULL, &format);
+       v4l2_fill_pix_format(&f->fmt.pix, &format.format);
 
        return rc;
 }
@@ -1061,7 +1062,9 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id norm)
 {
        struct cx231xx_fh *fh = priv;
        struct cx231xx *dev = fh->dev;
-       struct v4l2_mbus_framefmt mbus_fmt;
+       struct v4l2_subdev_format format = {
+               .which = V4L2_SUBDEV_FORMAT_ACTIVE,
+       };
        int rc;
 
        rc = check_dev(dev);
@@ -1085,11 +1088,10 @@ static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id norm)
        /* We need to reset basic properties in the decoder related to
           resolution (since a standard change effects things like the number
           of lines in VACT, etc) */
-       memset(&mbus_fmt, 0, sizeof(mbus_fmt));
-       mbus_fmt.code = MEDIA_BUS_FMT_FIXED;
-       mbus_fmt.width = dev->width;
-       mbus_fmt.height = dev->height;
-       call_all(dev, video, s_mbus_fmt, &mbus_fmt);
+       format.format.code = MEDIA_BUS_FMT_FIXED;
+       format.format.width = dev->width;
+       format.format.height = dev->height;
+       call_all(dev, pad, set_fmt, NULL, &format);
 
        /* do mode control overrides */
        cx231xx_do_mode_ctrl_overrides(dev);
@@ -1112,7 +1114,8 @@ int cx231xx_enum_input(struct file *file, void *priv,
        struct cx231xx_fh *fh = priv;
        struct cx231xx *dev = fh->dev;
        u32 gen_stat;
-       unsigned int ret, n;
+       unsigned int n;
+       int ret;
 
        n = i->index;
        if (n >= MAX_CX231XX_INPUT)
@@ -1873,7 +1876,7 @@ static int cx231xx_close(struct file *filp)
                        v4l2_fh_exit(&fh->fh);
                        kfree(fh);
                        dev->users--;
-                       wake_up_interruptible_nr(&dev->open, 1);
+                       wake_up_interruptible(&dev->open);
                        return 0;
                }
 
@@ -1906,7 +1909,7 @@ static int cx231xx_close(struct file *filp)
        }
        v4l2_fh_exit(&fh->fh);
        kfree(fh);
-       wake_up_interruptible_nr(&dev->open, 1);
+       wake_up_interruptible(&dev->open);
        return 0;
 }