[PATCH 431/437] pci: hotplug: cpqphp: convert to read/write iterators

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


Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>
---
drivers/pci/hotplug/cpqphp_sysfs.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/pci/hotplug/cpqphp_sysfs.c b/drivers/pci/hotplug/cpqphp_sysfs.c
index fed1360ee9b1..234e7ab66660 100644
--- a/drivers/pci/hotplug/cpqphp_sysfs.c
+++ b/drivers/pci/hotplug/cpqphp_sysfs.c
@@ -157,11 +157,10 @@ static loff_t lseek(struct file *file, loff_t off, int whence)
return fixed_size_llseek(file, off, whence, dbg->size);
}

-static ssize_t read(struct file *file, char __user *buf,
- size_t nbytes, loff_t *ppos)
+static ssize_t read(struct kiocb *iocb, struct iov_iter *to)
{
- struct ctrl_dbg *dbg = file->private_data;
- return simple_read_from_buffer(buf, nbytes, ppos, dbg->data, dbg->size);
+ struct ctrl_dbg *dbg = iocb->ki_filp->private_data;
+ return simple_copy_from_iter(dbg->data, &iocb->ki_pos, dbg->size, to);
}

static int release(struct inode *inode, struct file *file)
@@ -177,7 +176,7 @@ static const struct file_operations debug_ops = {
.owner = THIS_MODULE,
.open = open,
.llseek = lseek,
- .read = read,
+ .read_iter = read,
.release = release,
};

--
2.43.0