aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/gmidi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/gadget/gmidi.c')
-rw-r--r--drivers/usb/gadget/gmidi.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/usb/gadget/gmidi.c b/drivers/usb/gadget/gmidi.c
index 47b86b99d449..8b9220e128a7 100644
--- a/drivers/usb/gadget/gmidi.c
+++ b/drivers/usb/gadget/gmidi.c
@@ -537,14 +537,16 @@ static int set_gmidi_config(struct gmidi_device *dev, gfp_t gfp_flags)
537 struct usb_ep *ep; 537 struct usb_ep *ep;
538 unsigned i; 538 unsigned i;
539 539
540 err = usb_ep_enable(dev->in_ep, &bulk_in_desc); 540 dev->in_ep->desc = &bulk_in_desc;
541 err = usb_ep_enable(dev->in_ep);
541 if (err) { 542 if (err) {
542 ERROR(dev, "can't start %s: %d\n", dev->in_ep->name, err); 543 ERROR(dev, "can't start %s: %d\n", dev->in_ep->name, err);
543 goto fail; 544 goto fail;
544 } 545 }
545 dev->in_ep->driver_data = dev; 546 dev->in_ep->driver_data = dev;
546 547
547 err = usb_ep_enable(dev->out_ep, &bulk_out_desc); 548 dev->out_ep->desc = &bulk_out_desc;
549 err = usb_ep_enable(dev->out_ep);
548 if (err) { 550 if (err) {
549 ERROR(dev, "can't start %s: %d\n", dev->out_ep->name, err); 551 ERROR(dev, "can't start %s: %d\n", dev->out_ep->name, err);
550 goto fail; 552 goto fail;
@@ -693,6 +695,7 @@ static int gmidi_setup(struct usb_gadget *gadget,
693 switch (w_value >> 8) { 695 switch (w_value >> 8) {
694 696
695 case USB_DT_DEVICE: 697 case USB_DT_DEVICE:
698 device_desc.bMaxPacketSize0 = gadget->ep0->maxpacket;
696 value = min(w_length, (u16) sizeof(device_desc)); 699 value = min(w_length, (u16) sizeof(device_desc));
697 memcpy(req->buf, &device_desc, value); 700 memcpy(req->buf, &device_desc, value);
698 break; 701 break;
@@ -1247,8 +1250,6 @@ autoconf_fail:
1247 1250
1248 dev->req->complete = gmidi_setup_complete; 1251 dev->req->complete = gmidi_setup_complete;
1249 1252
1250 device_desc.bMaxPacketSize0 = gadget->ep0->maxpacket;
1251
1252 gadget->ep0->driver_data = dev; 1253 gadget->ep0->driver_data = dev;
1253 1254
1254 INFO(dev, "%s, version: " DRIVER_VERSION "\n", longname); 1255 INFO(dev, "%s, version: " DRIVER_VERSION "\n", longname);