diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2005-04-25 11:28:04 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-06-27 17:43:49 -0400 |
commit | 247f3105636caa9d1d8a4c3dfb755de42633bc80 (patch) | |
tree | f5fca7b566ee3304d661485a11dc4877652e7904 /drivers/usb/host/ohci-hcd.c | |
parent | 8ec8d20b21f00a36343ca0ebd6c6be9421724a1e (diff) |
[PATCH] USB HCDs: no longer need to register root hub
This patch changes the host controller drivers; they no longer need to
register their root hubs because usbcore will take care of it for them.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/ohci-hcd.c')
-rw-r--r-- | drivers/usb/host/ohci-hcd.c | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c index 0da996191251..13cd2177b557 100644 --- a/drivers/usb/host/ohci-hcd.c +++ b/drivers/usb/host/ohci-hcd.c | |||
@@ -505,13 +505,10 @@ static int ohci_init (struct ohci_hcd *ohci) | |||
505 | /* Start an OHCI controller, set the BUS operational | 505 | /* Start an OHCI controller, set the BUS operational |
506 | * resets USB and controller | 506 | * resets USB and controller |
507 | * enable interrupts | 507 | * enable interrupts |
508 | * connect the virtual root hub | ||
509 | */ | 508 | */ |
510 | static int ohci_run (struct ohci_hcd *ohci) | 509 | static int ohci_run (struct ohci_hcd *ohci) |
511 | { | 510 | { |
512 | u32 mask, temp; | 511 | u32 mask, temp; |
513 | struct usb_device *udev; | ||
514 | struct usb_bus *bus; | ||
515 | int first = ohci->fminterval == 0; | 512 | int first = ohci->fminterval == 0; |
516 | 513 | ||
517 | disable (ohci); | 514 | disable (ohci); |
@@ -672,36 +669,13 @@ retry: | |||
672 | 669 | ||
673 | // POTPGT delay is bits 24-31, in 2 ms units. | 670 | // POTPGT delay is bits 24-31, in 2 ms units. |
674 | mdelay ((temp >> 23) & 0x1fe); | 671 | mdelay ((temp >> 23) & 0x1fe); |
675 | bus = &ohci_to_hcd(ohci)->self; | ||
676 | ohci_to_hcd(ohci)->state = HC_STATE_RUNNING; | 672 | ohci_to_hcd(ohci)->state = HC_STATE_RUNNING; |
677 | 673 | ||
678 | ohci_dump (ohci, 1); | 674 | ohci_dump (ohci, 1); |
679 | 675 | ||
680 | udev = bus->root_hub; | 676 | if (ohci_to_hcd(ohci)->self.root_hub == NULL) |
681 | if (udev) { | 677 | create_debug_files (ohci); |
682 | return 0; | ||
683 | } | ||
684 | |||
685 | /* connect the virtual root hub */ | ||
686 | udev = usb_alloc_dev (NULL, bus, 0); | ||
687 | if (!udev) { | ||
688 | disable (ohci); | ||
689 | ohci->hc_control &= ~OHCI_CTRL_HCFS; | ||
690 | ohci_writel (ohci, ohci->hc_control, &ohci->regs->control); | ||
691 | return -ENOMEM; | ||
692 | } | ||
693 | |||
694 | udev->speed = USB_SPEED_FULL; | ||
695 | if (usb_hcd_register_root_hub (udev, ohci_to_hcd(ohci)) != 0) { | ||
696 | usb_put_dev (udev); | ||
697 | disable (ohci); | ||
698 | ohci->hc_control &= ~OHCI_CTRL_HCFS; | ||
699 | ohci_writel (ohci, ohci->hc_control, &ohci->regs->control); | ||
700 | return -ENODEV; | ||
701 | } | ||
702 | 678 | ||
703 | register_reboot_notifier (&ohci->reboot_notifier); | ||
704 | create_debug_files (ohci); | ||
705 | return 0; | 679 | return 0; |
706 | } | 680 | } |
707 | 681 | ||