aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/wusbcore/rh.c
diff options
context:
space:
mode:
authorDavid Vrabel <david.vrabel@csr.com>2009-01-06 17:58:02 +0000
committerDavid Vrabel <david.vrabel@csr.com>2009-01-06 17:58:02 +0000
commit9a9b1d17ba59b78e4bae67f7a7cf546986a42e7d (patch)
tree319ec314e8b92788ab98bacd66f028b961210ece /drivers/usb/wusbcore/rh.c
parent2226b1c219a18804bc40e32a5d53c287a6c925d9 (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/usb/wusbcore/rh.c')
-rw-r--r--drivers/usb/wusbcore/rh.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/wusbcore/rh.c b/drivers/usb/wusbcore/rh.c
index 95c6fa3bf6b..407a9fcc89c 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)
struct wusb_port *port = wusb_port_by_idx(wusbhc, port_idx);
struct wusb_dev *wusb_dev = port->wusb_dev;
+ if (wusb_dev == NULL)
+ return -ENOTCONN;
+
port->status |= USB_PORT_STAT_RESET;
port->change |= USB_PORT_STAT_C_RESET;