]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: saa7146: Replace saa7146_ext_vv.vbi_fops with write function
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Sun, 26 Oct 2025 18:08:29 +0000 (20:08 +0200)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Mon, 3 Nov 2025 14:58:42 +0000 (15:58 +0100)
The vbi_fops stored in struct saa7146_ext_vv is a full
v4l2_file_operations, but only its .write field is used. Replace it with
a single vbi_write function pointer to save memory.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/common/saa7146/saa7146_fops.c
drivers/staging/media/av7110/av7110_v4l.c
include/media/drv-intf/saa7146_vv.h

index 9d0362a75ecd5e6ef064c6449b70201f7ac05556..a9e3bad76d540a9497627ad3fd7f979633996bc9 100644 (file)
@@ -186,11 +186,11 @@ static ssize_t fops_write(struct file *file, const char __user *data, size_t cou
        struct saa7146_dev *dev = video_drvdata(file);
        int ret;
 
-       if (vdev->vfl_type != VFL_TYPE_VBI || !dev->ext_vv_data->vbi_fops.write)
+       if (vdev->vfl_type != VFL_TYPE_VBI || !dev->ext_vv_data->vbi_write)
                return -EINVAL;
        if (mutex_lock_interruptible(vdev->lock))
                return -ERESTARTSYS;
-       ret = dev->ext_vv_data->vbi_fops.write(file, data, count, ppos);
+       ret = dev->ext_vv_data->vbi_write(file, data, count, ppos);
        mutex_unlock(vdev->lock);
        return ret;
 }
index 04e659243f02bc588b8140d55a3de44e664ff286..200a7a29ea3170fdfe077378e89b20b8e07772be 100644 (file)
@@ -940,7 +940,7 @@ static struct saa7146_ext_vv av7110_vv_data_st = {
        .num_stds       = ARRAY_SIZE(standard),
        .std_callback   = &std_callback,
 
-       .vbi_fops.write = av7110_vbi_write,
+       .vbi_write      = av7110_vbi_write,
 };
 
 static struct saa7146_ext_vv av7110_vv_data_c = {
@@ -953,6 +953,6 @@ static struct saa7146_ext_vv av7110_vv_data_c = {
        .num_stds       = ARRAY_SIZE(standard),
        .std_callback   = &std_callback,
 
-       .vbi_fops.write = av7110_vbi_write,
+       .vbi_write      = av7110_vbi_write,
 };
 
index 55c7d70b9febccbd94b275fc939f9b574b3a6773..f66f4dfccf14b924511c09a8c1afa38782a4cf1c 100644 (file)
@@ -130,7 +130,8 @@ struct saa7146_ext_vv
        /* pointer to the saa7146 core ops */
        const struct v4l2_ioctl_ops *core_ops;
 
-       struct v4l2_file_operations vbi_fops;
+       ssize_t (*vbi_write)(struct file *file, const char __user *data,
+                            size_t count, loff_t *ppos);
 };
 
 struct saa7146_use_ops  {