[PATCH 360/437] hwmon: asus_atk0110: convert to read/write iterators

From: Jens Axboe
Date: Thu Apr 11 2024 - 13:02:41 EST


Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>
---
drivers/hwmon/asus_atk0110.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/hwmon/asus_atk0110.c b/drivers/hwmon/asus_atk0110.c
index d778a2aaefec..bd6eabfd7d73 100644
--- a/drivers/hwmon/asus_atk0110.c
+++ b/drivers/hwmon/asus_atk0110.c
@@ -764,13 +764,12 @@ static int atk_debugfs_ggrp_open(struct inode *inode, struct file *file)
return nonseekable_open(inode, file);
}

-static ssize_t atk_debugfs_ggrp_read(struct file *file, char __user *buf,
- size_t count, loff_t *pos)
+static ssize_t atk_debugfs_ggrp_read(struct kiocb *iocb, struct iov_iter *to)
{
- char *str = file->private_data;
+ char *str = iocb->ki_filp->private_data;
size_t len = strlen(str);

- return simple_read_from_buffer(buf, count, pos, str, len);
+ return simple_copy_to_iter(str, &iocb->ki_pos, len, to);
}

static int atk_debugfs_ggrp_release(struct inode *inode, struct file *file)
@@ -780,7 +779,7 @@ static int atk_debugfs_ggrp_release(struct inode *inode, struct file *file)
}

static const struct file_operations atk_debugfs_ggrp_fops = {
- .read = atk_debugfs_ggrp_read,
+ .read_iter = atk_debugfs_ggrp_read,
.open = atk_debugfs_ggrp_open,
.release = atk_debugfs_ggrp_release,
.llseek = no_llseek,
--
2.43.0