Skip to content

Commit 7e8ca48

Browse files
Hans Verkuilmchehab
authored andcommitted
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>
1 parent 922b739 commit 7e8ca48

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/media/i2c/video-i2c.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -798,13 +798,13 @@ static int video_i2c_probe(struct i2c_client *client)
798798
queue->min_queued_buffers = 1;
799799
queue->ops = &video_i2c_video_qops;
800800
queue->mem_ops = &vb2_vmalloc_memops;
801+
queue->lock = &data->queue_lock;
801802

802803
ret = vb2_queue_init(queue);
803804
if (ret < 0)
804805
goto error_unregister_device;
805806

806807
data->vdev.queue = queue;
807-
data->vdev.queue->lock = &data->queue_lock;
808808

809809
snprintf(data->vdev.name, sizeof(data->vdev.name),
810810
"I2C %d-%d Transport Video",

0 commit comments

Comments
 (0)