Commit de3e581f authored by Ezequiel Garcia's avatar Ezequiel Garcia Committed by Mauro Carvalho Chehab

media: stk1160: Set the vb2_queue lock before calling vb2_queue_init

The vb2_queue will soon be mandatory. The videobuf2 core
will throw a verbose warning if it's not set.

The stk1160 driver is setting the queue lock, but after
the vb2_queue_init call. Avoid the warning by setting
the lock before the queue initialization.
Signed-off-by: default avatarEzequiel Garcia <ezequiel@collabora.com>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 1d120649
...@@ -802,6 +802,7 @@ int stk1160_vb2_setup(struct stk1160 *dev) ...@@ -802,6 +802,7 @@ int stk1160_vb2_setup(struct stk1160 *dev)
q->buf_struct_size = sizeof(struct stk1160_buffer); q->buf_struct_size = sizeof(struct stk1160_buffer);
q->ops = &stk1160_video_qops; q->ops = &stk1160_video_qops;
q->mem_ops = &vb2_vmalloc_memops; q->mem_ops = &vb2_vmalloc_memops;
q->lock = &dev->vb_queue_lock;
q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
rc = vb2_queue_init(q); rc = vb2_queue_init(q);
...@@ -827,7 +828,6 @@ int stk1160_video_register(struct stk1160 *dev) ...@@ -827,7 +828,6 @@ int stk1160_video_register(struct stk1160 *dev)
* It will be used to protect *only* v4l2 ioctls. * It will be used to protect *only* v4l2 ioctls.
*/ */
dev->vdev.lock = &dev->v4l_lock; dev->vdev.lock = &dev->v4l_lock;
dev->vdev.queue->lock = &dev->vb_queue_lock;
/* This will be used to set video_device parent */ /* This will be used to set video_device parent */
dev->vdev.v4l2_dev = &dev->v4l2_dev; dev->vdev.v4l2_dev = &dev->v4l2_dev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment