[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240411153126.16201-366-axboe@kernel.dk>
Date: Thu, 11 Apr 2024 09:18:25 -0600
From: Jens Axboe <axboe@...nel.dk>
To: linux-kernel@...r.kernel.org
Cc: Jens Axboe <axboe@...nel.dk>
Subject: [PATCH 365/437] hwmon: pmbus: core: convert to read/write iterators
Signed-off-by: Jens Axboe <axboe@...nel.dk>
---
drivers/hwmon/pmbus/pmbus_core.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c
index cb4c65a7f288..39b340024c28 100644
--- a/drivers/hwmon/pmbus/pmbus_core.c
+++ b/drivers/hwmon/pmbus/pmbus_core.c
@@ -3303,11 +3303,10 @@ static int pmbus_debugfs_get_status(void *data, u64 *val)
DEFINE_DEBUGFS_ATTRIBUTE(pmbus_debugfs_ops_status, pmbus_debugfs_get_status,
NULL, "0x%04llx\n");
-static ssize_t pmbus_debugfs_mfr_read(struct file *file, char __user *buf,
- size_t count, loff_t *ppos)
+static ssize_t pmbus_debugfs_mfr_read(struct kiocb *iocb, struct iov_iter *to)
{
int rc;
- struct pmbus_debugfs_entry *entry = file->private_data;
+ struct pmbus_debugfs_entry *entry = iocb->ki_filp->private_data;
struct pmbus_data *pdata = i2c_get_clientdata(entry->client);
char data[I2C_SMBUS_BLOCK_MAX + 2] = { 0 };
@@ -3326,13 +3325,12 @@ static ssize_t pmbus_debugfs_mfr_read(struct file *file, char __user *buf,
/* Include newline into the length */
rc += 1;
- return simple_read_from_buffer(buf, count, ppos, data, rc);
+ return simple_copy_to_iter(data, &iocb->ki_pos, rc, to);
}
static const struct file_operations pmbus_debugfs_ops_mfr = {
.llseek = noop_llseek,
- .read = pmbus_debugfs_mfr_read,
- .write = NULL,
+ .read_iter = pmbus_debugfs_mfr_read,
.open = simple_open,
};
--
2.43.0
Powered by blists - more mailing lists