Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Laurent Pinchart and committed by
Hans Verkuil
ba92a96b bc22cd5e

+6 -5
+2 -2
drivers/media/common/saa7146/saa7146_fops.c
··· 186 186 struct saa7146_dev *dev = video_drvdata(file); 187 187 int ret; 188 188 189 - if (vdev->vfl_type != VFL_TYPE_VBI || !dev->ext_vv_data->vbi_fops.write) 189 + if (vdev->vfl_type != VFL_TYPE_VBI || !dev->ext_vv_data->vbi_write) 190 190 return -EINVAL; 191 191 if (mutex_lock_interruptible(vdev->lock)) 192 192 return -ERESTARTSYS; 193 - ret = dev->ext_vv_data->vbi_fops.write(file, data, count, ppos); 193 + ret = dev->ext_vv_data->vbi_write(file, data, count, ppos); 194 194 mutex_unlock(vdev->lock); 195 195 return ret; 196 196 }
+2 -2
drivers/staging/media/av7110/av7110_v4l.c
··· 940 940 .num_stds = ARRAY_SIZE(standard), 941 941 .std_callback = &std_callback, 942 942 943 - .vbi_fops.write = av7110_vbi_write, 943 + .vbi_write = av7110_vbi_write, 944 944 }; 945 945 946 946 static struct saa7146_ext_vv av7110_vv_data_c = { ··· 953 953 .num_stds = ARRAY_SIZE(standard), 954 954 .std_callback = &std_callback, 955 955 956 - .vbi_fops.write = av7110_vbi_write, 956 + .vbi_write = av7110_vbi_write, 957 957 }; 958 958
+2 -1
include/media/drv-intf/saa7146_vv.h
··· 130 130 /* pointer to the saa7146 core ops */ 131 131 const struct v4l2_ioctl_ops *core_ops; 132 132 133 - struct v4l2_file_operations vbi_fops; 133 + ssize_t (*vbi_write)(struct file *file, const char __user *data, 134 + size_t count, loff_t *ppos); 134 135 }; 135 136 136 137 struct saa7146_use_ops {