[PATCH 425/437] media: v4l2-dev: convert to read/write iterators
From: Jens Axboe
Date: Thu Apr 11 2024 - 13:17:26 EST
Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>
---
drivers/media/v4l2-core/v4l2-dev.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/media/v4l2-core/v4l2-dev.c b/drivers/media/v4l2-core/v4l2-dev.c
index d13954bd31fd..0ebc049fe333 100644
--- a/drivers/media/v4l2-core/v4l2-dev.c
+++ b/drivers/media/v4l2-core/v4l2-dev.c
@@ -318,6 +318,7 @@ static ssize_t v4l2_read(struct file *filp, char __user *buf,
video_device_node_name(vdev), sz, ret);
return ret;
}
+FOPS_READ_ITER_HELPER(v4l2_read);
static ssize_t v4l2_write(struct file *filp, const char __user *buf,
size_t sz, loff_t *off)
@@ -335,6 +336,7 @@ static ssize_t v4l2_write(struct file *filp, const char __user *buf,
video_device_node_name(vdev), sz, ret);
return ret;
}
+FOPS_WRITE_ITER_HELPER(v4l2_write);
static __poll_t v4l2_poll(struct file *filp, struct poll_table_struct *poll)
{
@@ -472,8 +474,8 @@ static int v4l2_release(struct inode *inode, struct file *filp)
static const struct file_operations v4l2_fops = {
.owner = THIS_MODULE,
- .read = v4l2_read,
- .write = v4l2_write,
+ .read_iter = v4l2_read_iter,
+ .write_iter = v4l2_write_iter,
.open = v4l2_open,
.get_unmapped_area = v4l2_get_unmapped_area,
.mmap = v4l2_mmap,
--
2.43.0