[RFC PATCH 19/57] drivers: usb: core: Use bus_find_device_by_devt helper

From: Suzuki K Poulose
Date: Mon Jun 03 2019 - 11:58:09 EST


Switch to using the bus_find_device_by_devt helper

Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
Cc: Oliver Neukum <oneukum@xxxxxxxx>
Cc: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
Cc: linux-usb@xxxxxxxxxxxxxxx
Signed-off-by: Suzuki K Poulose <suzuki.poulose@xxxxxxx>
---
drivers/usb/core/devio.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index fa783531..28358a3 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -947,17 +947,11 @@ static int parse_usbdevfs_streams(struct usb_dev_state *ps,
return ret;
}

-static int match_devt(struct device *dev, void *data)
-{
- return dev->devt == (dev_t) (unsigned long) data;
-}
-
static struct usb_device *usbdev_lookup_by_devt(dev_t devt)
{
struct device *dev;

- dev = bus_find_device(&usb_bus_type, NULL,
- (void *) (unsigned long) devt, match_devt);
+ dev = bus_find_device_by_devt(&usb_bus_type, NULL, devt);
if (!dev)
return NULL;
return to_usb_device(dev);
--
2.7.4