]> git.hungrycats.org Git - linux/commitdiff
USB: clean up usb_get_dev() as it was written quite horribly.
authorGreg Kroah-Hartman <greg@kroah.com>
Wed, 31 Mar 2004 06:08:01 +0000 (22:08 -0800)
committerGreg Kroah-Hartman <greg@kroah.com>
Wed, 31 Mar 2004 06:08:01 +0000 (22:08 -0800)
drivers/usb/core/usb.c

index bb2afb5de2aa23af8ee62cb8ed3d34d299ad214a..11d5c1b94fcea574f4ce8a1164ad4bc2f058d3d2 100644 (file)
@@ -770,16 +770,9 @@ usb_alloc_dev(struct usb_device *parent, struct usb_bus *bus, unsigned port)
  */
 struct usb_device *usb_get_dev (struct usb_device *dev)
 {
-       struct device *tmp;
-
-       if (!dev)
-               return NULL;
-
-       tmp = get_device(&dev->dev);
-       if (tmp)        
-               return to_usb_device(tmp);
-       else
-               return NULL;
+       if (dev)
+               get_device(&dev->dev);
+       return dev;
 }
 
 /**