Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] cx18: Move spinlock and vb_type initialisation into stream_init

The initialisation of vb_type in serialized_open was preventing
REQBUFS from working reliably. Remove it, and move the spinlock into
stream_init for good measure - it's only used when we have a stream
that supports videobuf anyway.

Signed-off-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

authored by

Simon Farnsworth and committed by
Mauro Carvalho Chehab
612031c0 d9c417b5

+2 -3
-3
drivers/media/video/cx18/cx18-fileops.c
··· 810 810 item->cx = cx; 811 811 item->type = s->type; 812 812 813 - spin_lock_init(&s->vbuf_q_lock); 814 - s->vb_type = 0; 815 - 816 813 item->open_id = cx->open_id++; 817 814 filp->private_data = &item->fh; 818 815
+2
drivers/media/video/cx18/cx18-streams.c
··· 275 275 init_timer(&s->vb_timeout); 276 276 spin_lock_init(&s->vb_lock); 277 277 if (type == CX18_ENC_STREAM_TYPE_YUV) { 278 + spin_lock_init(&s->vbuf_q_lock); 279 + 278 280 s->vb_type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 279 281 videobuf_queue_vmalloc_init(&s->vbuf_q, &cx18_videobuf_qops, 280 282 &cx->pci_dev->dev, &s->vbuf_q_lock,