aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2005-04-25 11:28:04 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-06-27 17:43:49 -0400
commit247f3105636caa9d1d8a4c3dfb755de42633bc80 (patch)
treef5fca7b566ee3304d661485a11dc4877652e7904 /drivers/usb/gadget
parent8ec8d20b21f00a36343ca0ebd6c6be9421724a1e (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/gadget')
-rw-r--r--drivers/usb/gadget/dummy_hcd.c24
1 files changed, 2 insertions, 22 deletions
diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c
index 9d37fc771b27..1918d10f7569 100644
--- a/drivers/usb/gadget/dummy_hcd.c
+++ b/drivers/usb/gadget/dummy_hcd.c
@@ -1625,7 +1625,6 @@ static DEVICE_ATTR (urbs, S_IRUGO, show_urbs, NULL);
1625static int dummy_start (struct usb_hcd *hcd) 1625static int dummy_start (struct usb_hcd *hcd)
1626{ 1626{
1627 struct dummy *dum; 1627 struct dummy *dum;
1628 struct usb_device *root;
1629 int retval; 1628 int retval;
1630 1629
1631 dum = hcd_to_dummy (hcd); 1630 dum = hcd_to_dummy (hcd);
@@ -1642,35 +1641,16 @@ static int dummy_start (struct usb_hcd *hcd)
1642 1641
1643 INIT_LIST_HEAD (&dum->urbp_list); 1642 INIT_LIST_HEAD (&dum->urbp_list);
1644 1643
1645 root = usb_alloc_dev (NULL, &hcd->self, 0); 1644 if ((retval = dummy_register_udc (dum)) != 0)
1646 if (!root) 1645 return retval;
1647 return -ENOMEM;
1648 1646
1649 /* only show a low-power port: just 8mA */ 1647 /* only show a low-power port: just 8mA */
1650 hcd->power_budget = 8; 1648 hcd->power_budget = 8;
1651
1652 /* root hub enters addressed state... */
1653 hcd->state = HC_STATE_RUNNING; 1649 hcd->state = HC_STATE_RUNNING;
1654 root->speed = USB_SPEED_HIGH;
1655
1656 /* ...then configured, so khubd sees us. */
1657 if ((retval = usb_hcd_register_root_hub (root, hcd)) != 0) {
1658 goto err1;
1659 }
1660
1661 if ((retval = dummy_register_udc (dum)) != 0)
1662 goto err2;
1663 1650
1664 /* FIXME 'urbs' should be a per-device thing, maybe in usbcore */ 1651 /* FIXME 'urbs' should be a per-device thing, maybe in usbcore */
1665 device_create_file (dummy_dev(dum), &dev_attr_urbs); 1652 device_create_file (dummy_dev(dum), &dev_attr_urbs);
1666 return 0; 1653 return 0;
1667
1668 err2:
1669 usb_disconnect (&hcd->self.root_hub);
1670 err1:
1671 usb_put_dev (root);
1672 hcd->state = HC_STATE_QUIESCING;
1673 return retval;
1674} 1654}
1675 1655
1676static void dummy_stop (struct usb_hcd *hcd) 1656static void dummy_stop (struct usb_hcd *hcd)