Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 93380
b: refs/heads/master
c: 4953d14
h: refs/heads/master
v: v3
  • Loading branch information
David Vrabel authored and Greg Kroah-Hartman committed Apr 25, 2008
1 parent c6b6737 commit 09da903
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 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: fc721f5194dc98c8108fb155a4fbae1cd746cf41
refs/heads/master: 4953d141dc5db748475001cfbfdcc42e66cf900e
14 changes: 11 additions & 3 deletions trunk/drivers/usb/core/hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -1245,6 +1245,13 @@ static void release_address(struct usb_device *udev)
}
}

static void update_address(struct usb_device *udev, int devnum)
{
/* The address for a WUSB device is managed by wusbcore. */
if (!udev->wusb)
udev->devnum = devnum;
}

#ifdef CONFIG_USB_SUSPEND

static void usb_stop_pm(struct usb_device *udev)
Expand Down Expand Up @@ -1733,7 +1740,7 @@ static int hub_port_reset(struct usb_hub *hub, int port1,
case 0:
/* TRSTRCY = 10 ms; plus some extra */
msleep(10 + 40);
udev->devnum = 0; /* Device now at address 0 */
update_address(udev, 0);
/* FALL THROUGH */
case -ENOTCONN:
case -ENODEV:
Expand Down Expand Up @@ -2236,7 +2243,8 @@ static int hub_set_address(struct usb_device *udev, int devnum)
USB_REQ_SET_ADDRESS, 0, devnum, 0,
NULL, 0, USB_CTRL_SET_TIMEOUT);
if (retval == 0) {
udev->devnum = devnum; /* Device now using proper address */
/* Device now using proper address. */
update_address(udev, devnum);
usb_set_device_state(udev, USB_STATE_ADDRESS);
usb_ep0_reinit(udev);
}
Expand Down Expand Up @@ -2491,7 +2499,7 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1,
fail:
if (retval) {
hub_port_disable(hub, port1, 0);
udev->devnum = devnum; /* for disconnect processing */
update_address(udev, devnum); /* for disconnect processing */
}
mutex_unlock(&usb_address0_mutex);
return retval;
Expand Down

0 comments on commit 09da903

Please sign in to comment.