ChangeSet 1.971, 2002/12/27 19:29:40-08:00, greg@kroah.com [PATCH] USB: rename usb_free_dev() to usb_put_dev() This was done to make the next reference count patch easier, and because almost everyone was already calling usb_put_dev() anyway... diff -Nru a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c --- a/drivers/usb/core/hub.c Fri Dec 27 23:55:20 2002 +++ b/drivers/usb/core/hub.c Fri Dec 27 23:55:20 2002 @@ -876,7 +876,7 @@ /* Reset the device, and detect its speed */ if (usb_hub_port_reset(hub, port, dev, delay)) { - usb_free_dev(dev); + usb_put_dev(dev); break; } @@ -928,7 +928,7 @@ goto done; /* Free the configuration if there was an error */ - usb_free_dev(dev); + usb_put_dev(dev); /* Switch to a long reset time */ delay = HUB_LONG_RESET_TIME; diff -Nru a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c --- a/drivers/usb/core/usb.c Fri Dec 27 23:55:20 2002 +++ b/drivers/usb/core/usb.c Fri Dec 27 23:55:20 2002 @@ -716,7 +716,7 @@ } /** - * usb_free_dev - free a usb device structure when all users of it are finished. + * usb_put_dev - free a usb device structure when all users of it are finished. * @dev: device that's been disconnected * Context: !in_interrupt () * @@ -727,7 +727,7 @@ * gone, everything is cleaned up, so it's time to get rid of these last * records of this device. */ -void usb_free_dev(struct usb_device *dev) +void usb_put_dev(struct usb_device *dev) { if (atomic_dec_and_test(&dev->refcnt)) { if (dev->bus->op->deallocate) @@ -738,7 +738,6 @@ } } - /** * usb_get_current_frame_number - return current bus frame number * @dev: the device whose bus is being queried @@ -1454,7 +1453,7 @@ EXPORT_SYMBOL(usb_device_remove); EXPORT_SYMBOL(usb_alloc_dev); -EXPORT_SYMBOL(usb_free_dev); +EXPORT_SYMBOL(usb_put_dev); EXPORT_SYMBOL(usb_get_dev); EXPORT_SYMBOL(usb_hub_tt_clear_buffer); diff -Nru a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c --- a/drivers/usb/host/ehci-hcd.c Fri Dec 27 23:55:20 2002 +++ b/drivers/usb/host/ehci-hcd.c Fri Dec 27 23:55:20 2002 @@ -476,7 +476,7 @@ ehci_ready (ehci); ehci_reset (ehci); bus->root_hub = 0; - usb_free_dev (udev); + usb_put_dev (udev); retval = -ENODEV; goto done2; } diff -Nru a/drivers/usb/host/hc_sl811_rh.c b/drivers/usb/host/hc_sl811_rh.c --- a/drivers/usb/host/hc_sl811_rh.c Fri Dec 27 23:55:20 2002 +++ b/drivers/usb/host/hc_sl811_rh.c Fri Dec 27 23:55:20 2002 @@ -566,7 +566,7 @@ hci->bus->root_hub = usb_dev; usb_connect (usb_dev); if (usb_new_device (usb_dev) != 0) { - usb_free_dev (usb_dev); + usb_put_dev (usb_dev); return -ENODEV; } diff -Nru a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c --- a/drivers/usb/host/ohci-hcd.c Fri Dec 27 23:55:20 2002 +++ b/drivers/usb/host/ohci-hcd.c Fri Dec 27 23:55:20 2002 @@ -515,7 +515,7 @@ usb_connect (udev); udev->speed = USB_SPEED_FULL; if (usb_register_root_hub (udev, ohci->hcd.controller) != 0) { - usb_free_dev (udev); + usb_put_dev (udev); ohci->hcd.self.root_hub = NULL; disable (ohci); ohci->hc_control &= ~OHCI_CTRL_HCFS; diff -Nru a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c --- a/drivers/usb/host/uhci-hcd.c Fri Dec 27 23:55:20 2002 +++ b/drivers/usb/host/uhci-hcd.c Fri Dec 27 23:55:20 2002 @@ -2280,7 +2280,7 @@ uhci->term_td = NULL; err_alloc_term_td: - usb_free_dev(udev); + usb_put_dev(udev); hcd->self.root_hub = NULL; err_alloc_root_hub: diff -Nru a/include/linux/usb.h b/include/linux/usb.h --- a/include/linux/usb.h Fri Dec 27 23:55:20 2002 +++ b/include/linux/usb.h Fri Dec 27 23:55:20 2002 @@ -261,8 +261,7 @@ extern struct usb_device *usb_alloc_dev(struct usb_device *parent, struct usb_bus *); extern struct usb_device *usb_get_dev(struct usb_device *dev); -extern void usb_free_dev(struct usb_device *); -#define usb_put_dev usb_free_dev +extern void usb_put_dev(struct usb_device *dev); /* mostly for devices emulating SCSI over USB */ extern int usb_reset_device(struct usb_device *dev);