diff options
author | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2024-09-02 16:04:48 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2024-10-12 15:53:50 +0200 |
commit | 3653f14841dc2a76d1fb9997e249715899bf4fb1 (patch) | |
tree | a02308dd60740264046cc285b68d92aceb36f3a3 | |
parent | 547629f7b167a5f27a040e80aa7991b12172ef0e (diff) | |
download | linux-stable-3653f14841dc2a76d1fb9997e249715899bf4fb1.tar.gz linux-stable-3653f14841dc2a76d1fb9997e249715899bf4fb1.tar.bz2 linux-stable-3653f14841dc2a76d1fb9997e249715899bf4fb1.zip |
media: pwc: 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>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-rw-r--r-- | drivers/media/usb/pwc/pwc-if.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/usb/pwc/pwc-if.c b/drivers/media/usb/pwc/pwc-if.c index e342199711d3..4a8485ea0c81 100644 --- a/drivers/media/usb/pwc/pwc-if.c +++ b/drivers/media/usb/pwc/pwc-if.c @@ -1054,6 +1054,7 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id pdev->vb_queue.ops = &pwc_vb_queue_ops; pdev->vb_queue.mem_ops = &vb2_vmalloc_memops; pdev->vb_queue.timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; + pdev->vb_queue.lock = &pdev->vb_queue_lock; rc = vb2_queue_init(&pdev->vb_queue); if (rc < 0) { PWC_ERROR("Oops, could not initialize vb2 queue.\n"); @@ -1064,7 +1065,6 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id pdev->vdev = pwc_template; strscpy(pdev->vdev.name, name, sizeof(pdev->vdev.name)); pdev->vdev.queue = &pdev->vb_queue; - pdev->vdev.queue->lock = &pdev->vb_queue_lock; video_set_drvdata(&pdev->vdev, pdev); pdev->release = le16_to_cpu(udev->descriptor.bcdDevice); |