diff options
author | Michael Tretter <m.tretter@pengutronix.de> | 2018-11-26 19:01:24 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-12-03 20:41:51 +0100 |
commit | b52b88ce5bd68e9f6ce4f01d2306e61ce34fc5a0 (patch) | |
tree | e6108fbd081db62eadb6158df240cc6e87d159ba /samples | |
parent | media: v4l: ioctl: Allow drivers to fill in the format description (diff) | |
download | linux-b52b88ce5bd68e9f6ce4f01d2306e61ce34fc5a0.tar.xz linux-b52b88ce5bd68e9f6ce4f01d2306e61ce34fc5a0.zip |
media: v4l2-pci-skeleton: replace vb2_buffer with vb2_v4l2_buffer
Commit 2d7007153f0c ("[media] media: videobuf2: Restructure vb2_buffer")
replaced vb2_buffer with vb2_v4l2_buffer in all v4l2 drivers. The
restructuring skipped the v4l2-pci-skeleton, probably because it resides
outside the drivers directory.
The v4l2_buf_ops assume that the passed buffer is a vb2_v4l2_buffer.
This is not the case if the skel_buffer is based on vb2_buffer instead
of vb2_v4l2_buffer.
Replace vb2_buffer with vb2_v4l2_buffer in the skeleton to make sure
that future drivers that are based on the skeleton use vb2_v4l2_buffer.
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'samples')
-rw-r--r-- | samples/v4l/v4l2-pci-skeleton.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/samples/v4l/v4l2-pci-skeleton.c b/samples/v4l/v4l2-pci-skeleton.c index f520e3aef9c6..27ec30952cfa 100644 --- a/samples/v4l/v4l2-pci-skeleton.c +++ b/samples/v4l/v4l2-pci-skeleton.c @@ -80,13 +80,13 @@ struct skeleton { }; struct skel_buffer { - struct vb2_buffer vb; + struct vb2_v4l2_buffer vb; struct list_head list; }; -static inline struct skel_buffer *to_skel_buffer(struct vb2_buffer *vb2) +static inline struct skel_buffer *to_skel_buffer(struct vb2_v4l2_buffer *vbuf) { - return container_of(vb2, struct skel_buffer, vb); + return container_of(vbuf, struct skel_buffer, vb); } static const struct pci_device_id skeleton_pci_tbl[] = { @@ -212,8 +212,9 @@ static int buffer_prepare(struct vb2_buffer *vb) */ static void buffer_queue(struct vb2_buffer *vb) { + struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb); struct skeleton *skel = vb2_get_drv_priv(vb->vb2_queue); - struct skel_buffer *buf = to_skel_buffer(vb); + struct skel_buffer *buf = to_skel_buffer(vbuf); unsigned long flags; spin_lock_irqsave(&skel->qlock, flags); @@ -232,7 +233,7 @@ static void return_all_buffers(struct skeleton *skel, spin_lock_irqsave(&skel->qlock, flags); list_for_each_entry_safe(buf, node, &skel->buf_list, list) { - vb2_buffer_done(&buf->vb, state); + vb2_buffer_done(&buf->vb.vb2_buf, state); list_del(&buf->list); } spin_unlock_irqrestore(&skel->qlock, flags); |