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>
This commit is contained in:
parent
bc22cd5e07
commit
ba92a96b1e
|
|
@ -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);
|
struct saa7146_dev *dev = video_drvdata(file);
|
||||||
int ret;
|
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;
|
return -EINVAL;
|
||||||
if (mutex_lock_interruptible(vdev->lock))
|
if (mutex_lock_interruptible(vdev->lock))
|
||||||
return -ERESTARTSYS;
|
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);
|
mutex_unlock(vdev->lock);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -940,7 +940,7 @@ static struct saa7146_ext_vv av7110_vv_data_st = {
|
||||||
.num_stds = ARRAY_SIZE(standard),
|
.num_stds = ARRAY_SIZE(standard),
|
||||||
.std_callback = &std_callback,
|
.std_callback = &std_callback,
|
||||||
|
|
||||||
.vbi_fops.write = av7110_vbi_write,
|
.vbi_write = av7110_vbi_write,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct saa7146_ext_vv av7110_vv_data_c = {
|
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),
|
.num_stds = ARRAY_SIZE(standard),
|
||||||
.std_callback = &std_callback,
|
.std_callback = &std_callback,
|
||||||
|
|
||||||
.vbi_fops.write = av7110_vbi_write,
|
.vbi_write = av7110_vbi_write,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,8 @@ struct saa7146_ext_vv
|
||||||
/* pointer to the saa7146 core ops */
|
/* pointer to the saa7146 core ops */
|
||||||
const struct v4l2_ioctl_ops *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 {
|
struct saa7146_use_ops {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue