Switch to using the bus_find_device_by_devt helper

Cc: Greg Kroah-Hartman <[email protected]>
Cc: Oliver Neukum <[email protected]>
Cc: Sebastian Andrzej Siewior <[email protected]>
Cc: [email protected]
Signed-off-by: Suzuki K Poulose <[email protected]>
---
 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

Reply via email to