[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240411153126.16201-381-axboe@kernel.dk>
Date: Thu, 11 Apr 2024 09:18:40 -0600
From: Jens Axboe <axboe@...nel.dk>
To: linux-kernel@...r.kernel.org
Cc: Jens Axboe <axboe@...nel.dk>
Subject: [PATCH 380/437] iio: adis16480: convert to read/write iterators
Signed-off-by: Jens Axboe <axboe@...nel.dk>
---
drivers/iio/imu/adis16480.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/iio/imu/adis16480.c b/drivers/iio/imu/adis16480.c
index b40a55bba30c..2664a187872f 100644
--- a/drivers/iio/imu/adis16480.c
+++ b/drivers/iio/imu/adis16480.c
@@ -188,10 +188,10 @@ MODULE_PARM_DESC(low_rate_allow,
#ifdef CONFIG_DEBUG_FS
-static ssize_t adis16480_show_firmware_revision(struct file *file,
- char __user *userbuf, size_t count, loff_t *ppos)
+static ssize_t adis16480_show_firmware_revision(struct kiocb *iocb,
+ struct iov_iter *to)
{
- struct adis16480 *adis16480 = file->private_data;
+ struct adis16480 *adis16480 = iocb->ki_filp->private_data;
char buf[7];
size_t len;
u16 rev;
@@ -203,20 +203,20 @@ static ssize_t adis16480_show_firmware_revision(struct file *file,
len = scnprintf(buf, sizeof(buf), "%x.%x\n", rev >> 8, rev & 0xff);
- 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 adis16480_firmware_revision_fops = {
.open = simple_open,
- .read = adis16480_show_firmware_revision,
+ .read_iter = adis16480_show_firmware_revision,
.llseek = default_llseek,
.owner = THIS_MODULE,
};
-static ssize_t adis16480_show_firmware_date(struct file *file,
- char __user *userbuf, size_t count, loff_t *ppos)
+static ssize_t adis16480_show_firmware_date(struct kiocb *iocb,
+ struct iov_iter *to)
{
- struct adis16480 *adis16480 = file->private_data;
+ struct adis16480 *adis16480 = iocb->ki_filp->private_data;
u16 md, year;
char buf[12];
size_t len;
@@ -233,12 +233,12 @@ static ssize_t adis16480_show_firmware_date(struct file *file,
len = snprintf(buf, sizeof(buf), "%.2x-%.2x-%.4x\n",
md >> 8, md & 0xff, year);
- 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 adis16480_firmware_date_fops = {
.open = simple_open,
- .read = adis16480_show_firmware_date,
+ .read_iter = adis16480_show_firmware_date,
.llseek = default_llseek,
.owner = THIS_MODULE,
};
--
2.43.0
Powered by blists - more mailing lists