aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/usb.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2006-08-30 11:32:52 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2006-09-27 14:58:56 -0400
commit1720058343fa43a1a25bfad9e62ea06e7e9743b6 (patch)
tree8225039836451d9784f729cf5136d5ad0443658c /drivers/usb/core/usb.c
parentdd990f16a39d4e615c0b70a0ab50b79b32bfb16d (diff)
usbcore: trim down usb_bus structure
As part of the ongoing program to flatten out the HCD bus-glue layer, this patch (as771b) eliminates the hcpriv, release, and kref fields from struct usb_bus. hcpriv and release were not being used for anything worthwhile, and kref has been moved into the enclosing usb_hcd structure. Along with those changes, the patch gets rid of usb_bus_get and usb_bus_put, replacing them with usb_get_hcd and usb_put_hcd. The one interesting aspect is that the dev_set_drvdata call was removed from usb_put_hcd, where it clearly doesn't belong. This means the driver private data won't get reset to NULL. It shouldn't cause any problems, since the private data is undefined when no driver is bound. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/core/usb.c')
-rw-r--r--drivers/usb/core/usb.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index 7ab9d29215f..b0c0a993338 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -169,7 +169,7 @@ static void usb_release_dev(struct device *dev)
169 udev = to_usb_device(dev); 169 udev = to_usb_device(dev);
170 170
171 usb_destroy_configuration(udev); 171 usb_destroy_configuration(udev);
172 usb_bus_put(udev->bus); 172 usb_put_hcd(bus_to_hcd(udev->bus));
173 kfree(udev->product); 173 kfree(udev->product);
174 kfree(udev->manufacturer); 174 kfree(udev->manufacturer);
175 kfree(udev->serial); 175 kfree(udev->serial);
@@ -197,8 +197,7 @@ usb_alloc_dev(struct usb_device *parent, struct usb_bus *bus, unsigned port1)
197 if (!dev) 197 if (!dev)
198 return NULL; 198 return NULL;
199 199
200 bus = usb_bus_get(bus); 200 if (!usb_get_hcd(bus_to_hcd(bus))) {
201 if (!bus) {
202 kfree(dev); 201 kfree(dev);
203 return NULL; 202 return NULL;
204 } 203 }