summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/dummy_hcd.c
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 14:43:49 -0700
commit247f3105636caa9d1d8a4c3dfb755de42633bc80 (patch)
treef5fca7b566ee3304d661485a11dc4877652e7904 /drivers/usb/gadget/dummy_hcd.c
parent8ec8d20b21f00a36343ca0ebd6c6be9421724a1e (diff)
downloadlinux-247f3105636caa9d1d8a4c3dfb755de42633bc80.tar.gz
linux-247f3105636caa9d1d8a4c3dfb755de42633bc80.tar.bz2
linux-247f3105636caa9d1d8a4c3dfb755de42633bc80.zip
[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/dummy_hcd.c')
-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);
static int dummy_start (struct usb_hcd *hcd)
{
struct dummy *dum;
- struct usb_device *root;
int retval;
dum = hcd_to_dummy (hcd);
@@ -1642,35 +1641,16 @@ static int dummy_start (struct usb_hcd *hcd)
INIT_LIST_HEAD (&dum->urbp_list);
- root = usb_alloc_dev (NULL, &hcd->self, 0);
- if (!root)
- return -ENOMEM;
+ if ((retval = dummy_register_udc (dum)) != 0)
+ return retval;
/* only show a low-power port: just 8mA */
hcd->power_budget = 8;
-
- /* root hub enters addressed state... */
hcd->state = HC_STATE_RUNNING;
- root->speed = USB_SPEED_HIGH;
-
- /* ...then configured, so khubd sees us. */
- if ((retval = usb_hcd_register_root_hub (root, hcd)) != 0) {
- goto err1;
- }
-
- if ((retval = dummy_register_udc (dum)) != 0)
- goto err2;
/* FIXME 'urbs' should be a per-device thing, maybe in usbcore */
device_create_file (dummy_dev(dum), &dev_attr_urbs);
return 0;
-
- err2:
- usb_disconnect (&hcd->self.root_hub);
- err1:
- usb_put_dev (root);
- hcd->state = HC_STATE_QUIESCING;
- return retval;
}
static void dummy_stop (struct usb_hcd *hcd)