summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2024-09-02 16:04:53 +0200
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2024-10-12 15:54:02 +0200
commit7e8ca483c0a96da6564bf7c57390e7c071fb5bae (patch)
tree83e1262c1912a19eb6ec87c871a7373811300d27
parent922b739445f39b31e243f517fd09630f5a406f0a (diff)
downloadlinux-stable-7e8ca483c0a96da6564bf7c57390e7c071fb5bae.tar.gz
linux-stable-7e8ca483c0a96da6564bf7c57390e7c071fb5bae.tar.bz2
linux-stable-7e8ca483c0a96da6564bf7c57390e7c071fb5bae.zip
media: video-i2c: set lock before calling vb2_queue_init()
The vb2_queue_init() will expect the vb2_queue lock pointer to be set in the future. So for those drivers that set the lock later, move it up to before the vb2_queue_init() call. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Acked-by: Matt Ranostay <matt@ranostay.sg> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-rw-r--r--drivers/media/i2c/video-i2c.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/i2c/video-i2c.c b/drivers/media/i2c/video-i2c.c
index 56dbe07a1c99..ffb3d9d61a74 100644
--- a/drivers/media/i2c/video-i2c.c
+++ b/drivers/media/i2c/video-i2c.c
@@ -798,13 +798,13 @@ static int video_i2c_probe(struct i2c_client *client)
queue->min_queued_buffers = 1;
queue->ops = &video_i2c_video_qops;
queue->mem_ops = &vb2_vmalloc_memops;
+ queue->lock = &data->queue_lock;
ret = vb2_queue_init(queue);
if (ret < 0)
goto error_unregister_device;
data->vdev.queue = queue;
- data->vdev.queue->lock = &data->queue_lock;
snprintf(data->vdev.name, sizeof(data->vdev.name),
"I2C %d-%d Transport Video",