diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2011-06-16 14:36:56 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-07-01 17:31:07 -0400 |
commit | 99fd14080e7f0a65b87830bf5062b09f6e80dd13 (patch) | |
tree | 68935492ae61590827f6d49935d7cd0273bcf637 /drivers/usb/gadget/dummy_hcd.c | |
parent | 2542787430fc46b4e07e0da4c6ec80ed230032e5 (diff) |
usb: gadget: dummy_hcd: set gadget.is_otg before calling bind()
Before commit 53832daea ("usb: gadget: dummy_hcd: use the shared_hcd
infrastructure") the is_otg field was set in dummy_udc_probe(). It seems
to me that this field is used in gadget's bind function. Therefore I'm
moving it before the bind() callback is called.
Cc: Tatyana Brokhman <tlinder@codeaurora.org
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/dummy_hcd.c')
-rw-r--r-- | drivers/usb/gadget/dummy_hcd.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c index cecc25ad4586..834fb923a062 100644 --- a/drivers/usb/gadget/dummy_hcd.c +++ b/drivers/usb/gadget/dummy_hcd.c | |||
@@ -929,6 +929,14 @@ static int dummy_udc_start(struct usb_gadget_driver *driver, | |||
929 | dum->ep[0].ep.maxpacket = 9; | 929 | dum->ep[0].ep.maxpacket = 9; |
930 | } else | 930 | } else |
931 | dum->ep[0].ep.maxpacket = 64; | 931 | dum->ep[0].ep.maxpacket = 64; |
932 | |||
933 | if (dum->gadget.speed == USB_SPEED_SUPER) | ||
934 | dum->gadget.is_otg = | ||
935 | (dummy_hcd_to_hcd(dum->ss_hcd)->self.otg_port != 0); | ||
936 | else | ||
937 | dum->gadget.is_otg = | ||
938 | (dummy_hcd_to_hcd(dum->hs_hcd)->self.otg_port != 0); | ||
939 | |||
932 | list_del_init (&dum->ep [0].ep.ep_list); | 940 | list_del_init (&dum->ep [0].ep.ep_list); |
933 | INIT_LIST_HEAD(&dum->fifo_req.queue); | 941 | INIT_LIST_HEAD(&dum->fifo_req.queue); |
934 | 942 | ||
@@ -944,13 +952,6 @@ static int dummy_udc_start(struct usb_gadget_driver *driver, | |||
944 | return retval; | 952 | return retval; |
945 | } | 953 | } |
946 | 954 | ||
947 | if (dum->gadget.speed == USB_SPEED_SUPER) | ||
948 | dum->gadget.is_otg = | ||
949 | (dummy_hcd_to_hcd(dum->ss_hcd)->self.otg_port != 0); | ||
950 | else | ||
951 | dum->gadget.is_otg = | ||
952 | (dummy_hcd_to_hcd(dum->hs_hcd)->self.otg_port != 0); | ||
953 | |||
954 | /* khubd will enumerate this in a while */ | 955 | /* khubd will enumerate this in a while */ |
955 | dummy_pullup(&dum->gadget, 1); | 956 | dummy_pullup(&dum->gadget, 1); |
956 | return 0; | 957 | return 0; |