Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 185325
b: refs/heads/master
c: f7410ce
h: refs/heads/master
i:
  185323: 59f63a9
v: v3
  • Loading branch information
Herbert Xu authored and Greg Kroah-Hartman committed Mar 2, 2010
1 parent 0d28607 commit 96c3570
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d23356da714595b888686d22cd19061323c09190
refs/heads/master: f7410ced7f931bb1ad79d1336412cf7b7a33cb14
2 changes: 1 addition & 1 deletion trunk/drivers/usb/core/hcd.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ struct hc_driver {
/* xHCI specific functions */
/* Called by usb_alloc_dev to alloc HC device structures */
int (*alloc_dev)(struct usb_hcd *, struct usb_device *);
/* Called by usb_release_dev to free HC device structures */
/* Called by usb_disconnect to free HC device structures */
void (*free_dev)(struct usb_hcd *, struct usb_device *);

/* Bandwidth computation functions */
Expand Down
12 changes: 12 additions & 0 deletions trunk/drivers/usb/core/hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -1524,6 +1524,15 @@ static void update_address(struct usb_device *udev, int devnum)
udev->devnum = devnum;
}

static void hub_free_dev(struct usb_device *udev)
{
struct usb_hcd *hcd = bus_to_hcd(udev->bus);

/* Root hubs aren't real devices, so don't free HCD resources */
if (hcd->driver->free_dev && udev->parent)
hcd->driver->free_dev(hcd, udev);
}

/**
* usb_disconnect - disconnect a device (usbcore-internal)
* @pdev: pointer to device being disconnected
Expand Down Expand Up @@ -1592,6 +1601,8 @@ void usb_disconnect(struct usb_device **pdev)
*pdev = NULL;
spin_unlock_irq(&device_state_lock);

hub_free_dev(udev);

put_device(&udev->dev);
}

Expand Down Expand Up @@ -3166,6 +3177,7 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1,
loop:
usb_ep0_reinit(udev);
release_address(udev);
hub_free_dev(udev);
usb_put_dev(udev);
if ((status == -ENOTCONN) || (status == -ENOTSUPP))
break;
Expand Down
3 changes: 0 additions & 3 deletions trunk/drivers/usb/core/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,6 @@ static void usb_release_dev(struct device *dev)
hcd = bus_to_hcd(udev->bus);

usb_destroy_configuration(udev);
/* Root hubs aren't real devices, so don't free HCD resources */
if (hcd->driver->free_dev && udev->parent)
hcd->driver->free_dev(hcd, udev);
usb_put_hcd(hcd);
kfree(udev->product);
kfree(udev->manufacturer);
Expand Down

0 comments on commit 96c3570

Please sign in to comment.