- if ((rhdev = usb_alloc_dev(NULL, &hcd->self, 0)) == NULL) {
- dev_err(hcd->self.controller, "unable to allocate root hub\n");
- retval = -ENOMEM;
- goto err_allocate_root_hub;
- }
- rhdev->speed = (hcd->driver->flags & HCD_USB2) ? USB_SPEED_HIGH :
- USB_SPEED_FULL;
- hcd->self.root_hub = rhdev;
-
- /* wakeup flag init defaults to "everything works" for root hubs,
- * but drivers can override it in reset() if needed, along with
- * recording the overall controller's system wakeup capability.
- */
- device_init_wakeup(&rhdev->dev, 1);
-
- /* "reset" is misnamed; its role is now one-time init. the controller
- * should already have been reset (and boot firmware kicked off etc).
- */
- if (hcd->driver->reset && (retval = hcd->driver->reset(hcd)) < 0) {
- dev_err(hcd->self.controller, "can't setup\n");
- goto err_hcd_driver_setup;
- }
-
- /* NOTE: root hub and controller capabilities may not be the same */
- if (device_can_wakeup(hcd->self.controller)
- && device_can_wakeup(&hcd->self.root_hub->dev))
- dev_dbg(hcd->self.controller, "supports USB remote wakeup\n");
-
- /* enable irqs just before we start the controller */