usb: Initialize hcd->state roothubs.
authorSarah Sharp <sarah.a.sharp@linux.intel.com>
Fri, 11 Mar 2011 21:46:17 +0000 (13:46 -0800)
committerSarah Sharp <sarah.a.sharp@linux.intel.com>
Mon, 14 Mar 2011 01:07:10 +0000 (18:07 -0700)
We would like to allow host controller drivers to stop using hcd->state.
Unfortunately, some host controller drivers use hcd->state as an
implicit way of telling the core that a controller has died.  The
roothub registration functions must assume the host died if hcd->state
equals HC_STATE_HALT.

To facilitate drivers that don't want to set hcd->state to
HC_STATE_RUNNING in their initialization routines, we set the state to
running before calling the host controller's start function.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
drivers/usb/core/hcd.c

index b70db6e78977e7e5501a6cb4ae6c234d6144fd51..a97ed6d293e915509f97495dc02c05b09394e2bb 100644 (file)
@@ -2347,6 +2347,7 @@ int usb_add_hcd(struct usb_hcd *hcd,
                                        (unsigned long long)hcd->rsrc_start);
        }
 
+       hcd->state = HC_STATE_RUNNING;
        retval = hcd->driver->start(hcd);
        if (retval < 0) {
                dev_err(hcd->self.controller, "startup error %d\n", retval);