[PATCH 364/437] hwmon: max20730: convert to read/write iterators

Jens Axboe
2024-04-11T15:41:51Z

drivers/hwmon/pmbus/max20730.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/hwmon/pmbus/max20730.c b/drivers/hwmon/pmbus/max20730.c
index d56ec24764fd..9b0c6084cf12 100644
--- a/drivers/hwmon/pmbus/max20730.c
+++ b/drivers/hwmon/pmbus/max20730.c
@@ -104,11 +104,10 @@ struct max20730_debugfs_data {
struct max20730_debugfs_data, debugfs_entries[(y)])

#ifdef CONFIG_DEBUG_FS
-static ssize_t max20730_debugfs_read(struct file *file, char __user *buf,
- size_t count, loff_t *ppos)
+static ssize_t max20730_debugfs_read(struct kiocb *iocb, struct iov_iter *to)
{
int ret, len;
- int *idxp = file->private_data;
+ int *idxp = iocb->ki_filp->private_data;
int idx = *idxp;
struct max20730_debugfs_data *psu = to_psu(idxp, idx);
const struct pmbus_driver_info *info;
@@ -292,13 +291,12 @@ static ssize_t max20730_debugfs_read(struct file *file, char __user *buf,
}

len = strlen(result);
- return simple_read_from_buffer(buf, count, ppos, result, len);
+ return simple_copy_to_iter(result, &iocb->ki_pos, len, to);
}

static const struct file_operations max20730_fops = {
.llseek = noop_llseek,
- .read = max20730_debugfs_read,
- .write = NULL,
+ .read_iter = max20730_debugfs_read,
.open = simple_open,
};

--
2.43.0