[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240411153126.16201-368-axboe@kernel.dk>
Date: Thu, 11 Apr 2024 09:18:27 -0600
From: Jens Axboe <axboe@...nel.dk>
To: linux-kernel@...r.kernel.org
Cc: Jens Axboe <axboe@...nel.dk>
Subject: [PATCH 367/437] hwmon: ucd9000: convert to read/write iterators
Signed-off-by: Jens Axboe <axboe@...nel.dk>
---
drivers/hwmon/pmbus/ucd9000.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/hwmon/pmbus/ucd9000.c b/drivers/hwmon/pmbus/ucd9000.c
index 8d9d422450e5..204c836fa322 100644
--- a/drivers/hwmon/pmbus/ucd9000.c
+++ b/drivers/hwmon/pmbus/ucd9000.c
@@ -471,11 +471,10 @@ static int ucd9000_debugfs_show_mfr_status_bit(void *data, u64 *val)
DEFINE_DEBUGFS_ATTRIBUTE(ucd9000_debugfs_mfr_status_bit,
ucd9000_debugfs_show_mfr_status_bit, NULL, "%1lld\n");
-static ssize_t ucd9000_debugfs_read_mfr_status(struct file *file,
- char __user *buf, size_t count,
- loff_t *ppos)
+static ssize_t ucd9000_debugfs_read_mfr_status(struct kiocb *iocb,
+ struct iov_iter *to)
{
- struct i2c_client *client = file->private_data;
+ struct i2c_client *client = iocb->ki_filp->private_data;
u8 buffer[I2C_SMBUS_BLOCK_MAX];
char str[(I2C_SMBUS_BLOCK_MAX * 2) + 2];
char *res;
@@ -489,12 +488,12 @@ static ssize_t ucd9000_debugfs_read_mfr_status(struct file *file,
*res++ = '\n';
*res = 0;
- return simple_read_from_buffer(buf, count, ppos, str, res - str);
+ return simple_copy_to_iter(str, &iocb->ki_pos, res - str, to);
}
static const struct file_operations ucd9000_debugfs_show_mfr_status_fops = {
.llseek = noop_llseek,
- .read = ucd9000_debugfs_read_mfr_status,
+ .read_iter = ucd9000_debugfs_read_mfr_status,
.open = simple_open,
};
--
2.43.0
Powered by blists - more mailing lists