Skip to content

Commit

Permalink
media: video-i2c: set lock before calling vb2_queue_init()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Oct 12, 2024
1 parent 922b739 commit 7e8ca48
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/i2c/video-i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 7e8ca48

Please sign in to comment.