]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
media: omap3isp: drop wait_prepare/finish callbacks
authorHans Verkuil <hverkuil@xs4all.nl>
Tue, 28 Jan 2025 15:08:18 +0000 (16:08 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Wed, 30 Apr 2025 06:16:06 +0000 (08:16 +0200)
Since commit 88785982a19d ("media: vb2: use lock if wait_prepare/finish
are NULL") it is no longer needed to set the wait_prepare/finish
vb2_ops callbacks as long as the lock field in vb2_queue is set.

Set the queue lock to &video->queue_lock, which makes it possible to drop
the wait_prepare/finish callbacks.

This simplifies the code and this is a step towards the goal of deleting
these callbacks.

Note that the lock field of struct video_device is never set in this
driver, so the core v4l2_ioctl.c function v4l2_ioctl_get_lock() will never
take a lock.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/ti/omap3isp/ispvideo.c

index 5c9aa80023fd660fa0f9b2e70564f2110c8dcfea..78e30298c7ad155c70a2a369daa8c232b97e55b7 100644 (file)
@@ -480,29 +480,11 @@ static int isp_video_start_streaming(struct vb2_queue *queue,
        return 0;
 }
 
-static void omap3isp_wait_prepare(struct vb2_queue *vq)
-{
-       struct isp_video_fh *vfh = vb2_get_drv_priv(vq);
-       struct isp_video *video = vfh->video;
-
-       mutex_unlock(&video->queue_lock);
-}
-
-static void omap3isp_wait_finish(struct vb2_queue *vq)
-{
-       struct isp_video_fh *vfh = vb2_get_drv_priv(vq);
-       struct isp_video *video = vfh->video;
-
-       mutex_lock(&video->queue_lock);
-}
-
 static const struct vb2_ops isp_video_queue_ops = {
        .queue_setup = isp_video_queue_setup,
        .buf_prepare = isp_video_buffer_prepare,
        .buf_queue = isp_video_buffer_queue,
        .start_streaming = isp_video_start_streaming,
-       .wait_prepare = omap3isp_wait_prepare,
-       .wait_finish = omap3isp_wait_finish,
 };
 
 /*
@@ -1338,6 +1320,7 @@ static int isp_video_open(struct file *file)
        queue->buf_struct_size = sizeof(struct isp_buffer);
        queue->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
        queue->dev = video->isp->dev;
+       queue->lock = &video->queue_lock;
 
        ret = vb2_queue_init(&handle->queue);
        if (ret < 0) {