diff options
author | David Vrabel <david.vrabel@csr.com> | 2009-01-06 12:58:02 -0500 |
---|---|---|
committer | David Vrabel <david.vrabel@csr.com> | 2009-01-06 12:58:02 -0500 |
commit | 9a9b1d17ba59b78e4bae67f7a7cf546986a42e7d (patch) | |
tree | 319ec314e8b92788ab98bacd66f028b961210ece /drivers | |
parent | 2226b1c219a18804bc40e32a5d53c287a6c925d9 (diff) |
wusb: return -ENOTCONN when resetting a port with no connected device
If reading the device descriptor fails during hub_port_init() fails,
then the port is disabled, disconnecting the device. The port is then
reset at the start of the next init attempt but there is no device to
reset.
Signed-off-by: David Vrabel <david.vrabel@csr.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/wusbcore/devconnect.c | 1 | ||||
-rw-r--r-- | drivers/usb/wusbcore/rh.c | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/drivers/usb/wusbcore/devconnect.c b/drivers/usb/wusbcore/devconnect.c index e2e7e4bc8463..8e18141bb2e0 100644 --- a/drivers/usb/wusbcore/devconnect.c +++ b/drivers/usb/wusbcore/devconnect.c | |||
@@ -386,6 +386,7 @@ static void __wusbhc_dev_disconnect(struct wusbhc *wusbhc, | |||
386 | | USB_PORT_STAT_LOW_SPEED | USB_PORT_STAT_HIGH_SPEED); | 386 | | USB_PORT_STAT_LOW_SPEED | USB_PORT_STAT_HIGH_SPEED); |
387 | port->change |= USB_PORT_STAT_C_CONNECTION | USB_PORT_STAT_C_ENABLE; | 387 | port->change |= USB_PORT_STAT_C_CONNECTION | USB_PORT_STAT_C_ENABLE; |
388 | if (wusb_dev) { | 388 | if (wusb_dev) { |
389 | dev_dbg(wusbhc->dev, "disconnecting device from port %d\n", wusb_dev->port_idx); | ||
389 | if (!list_empty(&wusb_dev->cack_node)) | 390 | if (!list_empty(&wusb_dev->cack_node)) |
390 | list_del_init(&wusb_dev->cack_node); | 391 | list_del_init(&wusb_dev->cack_node); |
391 | /* For the one in cack_add() */ | 392 | /* For the one in cack_add() */ |
diff --git a/drivers/usb/wusbcore/rh.c b/drivers/usb/wusbcore/rh.c index 95c6fa3bf6b2..407a9fcc89cc 100644 --- a/drivers/usb/wusbcore/rh.c +++ b/drivers/usb/wusbcore/rh.c | |||
@@ -100,6 +100,9 @@ static int wusbhc_rh_port_reset(struct wusbhc *wusbhc, u8 port_idx) | |||
100 | struct wusb_port *port = wusb_port_by_idx(wusbhc, port_idx); | 100 | struct wusb_port *port = wusb_port_by_idx(wusbhc, port_idx); |
101 | struct wusb_dev *wusb_dev = port->wusb_dev; | 101 | struct wusb_dev *wusb_dev = port->wusb_dev; |
102 | 102 | ||
103 | if (wusb_dev == NULL) | ||
104 | return -ENOTCONN; | ||
105 | |||
103 | port->status |= USB_PORT_STAT_RESET; | 106 | port->status |= USB_PORT_STAT_RESET; |
104 | port->change |= USB_PORT_STAT_C_RESET; | 107 | port->change |= USB_PORT_STAT_C_RESET; |
105 | 108 | ||