aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/s2255drv.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/s2255drv.c')
-rw-r--r--drivers/media/video/s2255drv.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/media/video/s2255drv.c b/drivers/media/video/s2255drv.c
index 4894cbb1c547..01c2179f0520 100644
--- a/drivers/media/video/s2255drv.c
+++ b/drivers/media/video/s2255drv.c
@@ -634,13 +634,11 @@ static void s2255_fillbuff(struct s2255_channel *channel,
634 const char *tmpbuf; 634 const char *tmpbuf;
635 char *vbuf = videobuf_to_vmalloc(&buf->vb); 635 char *vbuf = videobuf_to_vmalloc(&buf->vb);
636 unsigned long last_frame; 636 unsigned long last_frame;
637 struct s2255_framei *frm;
638 637
639 if (!vbuf) 638 if (!vbuf)
640 return; 639 return;
641 last_frame = channel->last_frame; 640 last_frame = channel->last_frame;
642 if (last_frame != -1) { 641 if (last_frame != -1) {
643 frm = &channel->buffer.frame[last_frame];
644 tmpbuf = 642 tmpbuf =
645 (const char *)channel->buffer.frame[last_frame].lpvbits; 643 (const char *)channel->buffer.frame[last_frame].lpvbits;
646 switch (buf->fmt->fourcc) { 644 switch (buf->fmt->fourcc) {
@@ -987,7 +985,6 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
987 struct videobuf_queue *q = &fh->vb_vidq; 985 struct videobuf_queue *q = &fh->vb_vidq;
988 struct s2255_mode mode; 986 struct s2255_mode mode;
989 int ret; 987 int ret;
990 int norm;
991 988
992 ret = vidioc_try_fmt_vid_cap(file, fh, f); 989 ret = vidioc_try_fmt_vid_cap(file, fh, f);
993 990
@@ -1018,7 +1015,6 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
1018 channel->height = f->fmt.pix.height; 1015 channel->height = f->fmt.pix.height;
1019 fh->vb_vidq.field = f->fmt.pix.field; 1016 fh->vb_vidq.field = f->fmt.pix.field;
1020 fh->type = f->type; 1017 fh->type = f->type;
1021 norm = norm_minw(&channel->vdev);
1022 if (channel->width > norm_minw(&channel->vdev)) { 1018 if (channel->width > norm_minw(&channel->vdev)) {
1023 if (channel->height > norm_minh(&channel->vdev)) { 1019 if (channel->height > norm_minh(&channel->vdev)) {
1024 if (channel->cap_parm.capturemode & 1020 if (channel->cap_parm.capturemode &
@@ -1826,8 +1822,7 @@ static void s2255_destroy(struct s2255_dev *dev)
1826 usb_free_urb(dev->fw_data->fw_urb); 1822 usb_free_urb(dev->fw_data->fw_urb);
1827 dev->fw_data->fw_urb = NULL; 1823 dev->fw_data->fw_urb = NULL;
1828 } 1824 }
1829 if (dev->fw_data->fw) 1825 release_firmware(dev->fw_data->fw);
1830 release_firmware(dev->fw_data->fw);
1831 kfree(dev->fw_data->pfw_data); 1826 kfree(dev->fw_data->pfw_data);
1832 kfree(dev->fw_data); 1827 kfree(dev->fw_data);
1833 /* reset the DSP so firmware can be reloaded next time */ 1828 /* reset the DSP so firmware can be reloaded next time */
@@ -1949,6 +1944,10 @@ static int s2255_probe_v4l(struct s2255_dev *dev)
1949 /* register 4 video devices */ 1944 /* register 4 video devices */
1950 channel->vdev = template; 1945 channel->vdev = template;
1951 channel->vdev.lock = &dev->lock; 1946 channel->vdev.lock = &dev->lock;
1947 /* Locking in file operations other than ioctl should be done
1948 by the driver, not the V4L2 core.
1949 This driver needs auditing so that this flag can be removed. */
1950 set_bit(V4L2_FL_LOCK_ALL_FOPS, &channel->vdev.flags);
1952 channel->vdev.v4l2_dev = &dev->v4l2_dev; 1951 channel->vdev.v4l2_dev = &dev->v4l2_dev;
1953 video_set_drvdata(&channel->vdev, channel); 1952 video_set_drvdata(&channel->vdev, channel);
1954 if (video_nr == -1) 1953 if (video_nr == -1)