[PATCH 158/437] usb: core: convert to read/write iterators

From: Jens Axboe
Date: Thu Apr 11 2024 - 12:15:34 EST


Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>
---
drivers/usb/core/devices.c | 3 ++-
drivers/usb/core/devio.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/core/devices.c b/drivers/usb/core/devices.c
index a247da73f34d..f367132a6770 100644
--- a/drivers/usb/core/devices.c
+++ b/drivers/usb/core/devices.c
@@ -538,8 +538,9 @@ static ssize_t usb_device_read(struct file *file, char __user *buf,
mutex_unlock(&usb_bus_idr_lock);
return total_written;
}
+FOPS_READ_ITER_HELPER(usb_device_read);

const struct file_operations usbfs_devices_fops = {
.llseek = no_seek_end_llseek,
- .read = usb_device_read,
+ .read_iter = usb_device_read_iter,
};
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index 3beb6a862e80..bebfbebc1f69 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -390,6 +390,7 @@ static ssize_t usbdev_read(struct file *file, char __user *buf, size_t nbytes,
usb_unlock_device(dev);
return ret;
}
+FOPS_READ_ITER_HELPER(usbdev_read);

/*
* async list handling
@@ -2846,7 +2847,7 @@ static __poll_t usbdev_poll(struct file *file,
const struct file_operations usbdev_file_operations = {
.owner = THIS_MODULE,
.llseek = no_seek_end_llseek,
- .read = usbdev_read,
+ .read_iter = usbdev_read_iter,
.poll = usbdev_poll,
.unlocked_ioctl = usbdev_ioctl,
.compat_ioctl = compat_ptr_ioctl,
--
2.43.0