media: saa7146: Replace saa7146_ext_vv.vbi_fops with write function

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>
pull/1354/merge
Laurent Pinchart 2025-10-26 20:08:29 +02:00 committed by Hans Verkuil
parent bc22cd5e07
commit ba92a96b1e
3 changed files with 6 additions and 5 deletions

View 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;
}

View 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,
};

View 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 {