]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
media: airspy: set lock before calling vb2_queue_init()
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Mon, 2 Sep 2024 14:04:51 +0000 (16:04 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Sat, 12 Oct 2024 13:53:54 +0000 (15:53 +0200)
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>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/usb/airspy/airspy.c

index e24e655fb1dbfb20687403b1b255159b01938be1..3e2a3099a8fe379bb9a92e07cdbc770fa6cb3661 100644 (file)
@@ -1017,6 +1017,7 @@ static int airspy_probe(struct usb_interface *intf,
        s->vb_queue.ops = &airspy_vb2_ops;
        s->vb_queue.mem_ops = &vb2_vmalloc_memops;
        s->vb_queue.timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
+       s->vb_queue.lock = &s->vb_queue_lock;
        ret = vb2_queue_init(&s->vb_queue);
        if (ret) {
                dev_err(s->dev, "Could not initialize vb2 queue\n");
@@ -1026,7 +1027,6 @@ static int airspy_probe(struct usb_interface *intf,
        /* Init video_device structure */
        s->vdev = airspy_template;
        s->vdev.queue = &s->vb_queue;
-       s->vdev.queue->lock = &s->vb_queue_lock;
        video_set_drvdata(&s->vdev, s);
 
        /* Register the v4l2_device structure */