summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2011-06-23 16:26:13 +0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-07-02 01:31:13 +0400
commitf8744d40ca12d54f35c56831040683d52e765bf8 (patch)
tree2a6d36725dc3a051b2ac6ed45dd340f9864f9705 /drivers/usb/gadget
parent0fb5759952e934dd5ff25fd79f45cb5d69c8d2d1 (diff)
downloadlinux-f8744d40ca12d54f35c56831040683d52e765bf8.tar.xz
usb: gadget: dummy_hcd: init is_otg in init_dummy_udc_hw()
This value is now assigned during bind(). The configuration depends on static values assigned by dummy driver itself. So there is no need to defer this assigment until one know the actuall speed since the configuration is static and known early. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r--drivers/usb/gadget/dummy_hcd.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c
index 3144092d828b..0ab2f565c12d 100644
--- a/drivers/usb/gadget/dummy_hcd.c
+++ b/drivers/usb/gadget/dummy_hcd.c
@@ -909,13 +909,6 @@ static int dummy_udc_start(struct usb_gadget_driver *driver,
dum->ep[0].ep.maxpacket = 64;
}
- if (dum->gadget.speed == USB_SPEED_SUPER)
- dum->gadget.is_otg =
- (dummy_hcd_to_hcd(dum->ss_hcd)->self.otg_port != 0);
- else
- dum->gadget.is_otg =
- (dummy_hcd_to_hcd(dum->hs_hcd)->self.otg_port != 0);
-
driver->driver.bus = NULL;
dum->driver = driver;
dum->gadget.dev.driver = &driver->driver;
@@ -990,6 +983,10 @@ static void init_dummy_udc_hw(struct dummy *dum)
dum->gadget.ep0 = &dum->ep[0].ep;
list_del_init(&dum->ep[0].ep.ep_list);
INIT_LIST_HEAD(&dum->fifo_req.queue);
+
+#ifdef CONFIG_USB_OTG
+ dum->gadget.is_otg = 1;
+#endif
}
static int dummy_udc_probe (struct platform_device *pdev)