[PATCH 378/437] iio: adis16400: convert to read/write iterators

From: Jens Axboe
Date: Thu Apr 11 2024 - 13:06:49 EST


Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>
---
drivers/iio/imu/adis16400.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/iio/imu/adis16400.c b/drivers/iio/imu/adis16400.c
index 3eda32e12a53..78182bc33bac 100644
--- a/drivers/iio/imu/adis16400.c
+++ b/drivers/iio/imu/adis16400.c
@@ -204,10 +204,10 @@ enum {

#ifdef CONFIG_DEBUG_FS

-static ssize_t adis16400_show_serial_number(struct file *file,
- char __user *userbuf, size_t count, loff_t *ppos)
+static ssize_t adis16400_show_serial_number(struct kiocb *iocb,
+ struct iov_iter *to)
{
- struct adis16400_state *st = file->private_data;
+ struct adis16400_state *st = iocb->ki_filp->private_data;
u16 lot1, lot2, serial_number;
char buf[16];
size_t len;
@@ -229,12 +229,12 @@ static ssize_t adis16400_show_serial_number(struct file *file,
len = snprintf(buf, sizeof(buf), "%.4x-%.4x-%.4x\n", lot1, lot2,
serial_number);

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

static const struct file_operations adis16400_serial_number_fops = {
.open = simple_open,
- .read = adis16400_show_serial_number,
+ .read_iter = adis16400_show_serial_number,
.llseek = default_llseek,
.owner = THIS_MODULE,
};
--
2.43.0