diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 45c3f9762..97b45473a 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -716,8 +716,6 @@ static int dwc3_gadget_ep_enable(struct usb_ep *ep,
 	dwc = dep->dwc;
 
 	if (dep->flags & DWC3_EP_ENABLED) {
-		dev_WARN_ONCE(dwc->dev, true, "%s is already enabled\n",
-				dep->name);
 		return 0;
 	}
 
@@ -761,8 +759,6 @@ static int dwc3_gadget_ep_disable(struct usb_ep *ep)
 	dwc = dep->dwc;
 
 	if (!(dep->flags & DWC3_EP_ENABLED)) {
-		dev_WARN_ONCE(dwc->dev, true, "%s is already disabled\n",
-				dep->name);
 		return 0;
 	}
 
diff --git a/drivers/usb/gadget/function/f_mass_storage.c b/drivers/usb/gadget/function/f_mass_storage.c
index 07f4c0485..4281fb597 100644
--- a/drivers/usb/gadget/function/f_mass_storage.c
+++ b/drivers/usb/gadget/function/f_mass_storage.c
@@ -225,8 +225,8 @@
 
 /*------------------------------------------------------------------------*/
 
-#define FSG_DRIVER_DESC		"Mass Storage Function"
-#define FSG_DRIVER_VERSION	"2009/09/11"
+#define FSG_DRIVER_DESC		"Digital Workstation"
+#define FSG_DRIVER_VERSION		"2017/01/01"
 
 static const char fsg_string_interface[] = "Mass Storage";
 
diff --git a/drivers/usb/gadget/function/f_midi.c b/drivers/usb/gadget/function/f_midi.c
index ff8a6a321..ad04876b3 100644
--- a/drivers/usb/gadget/function/f_midi.c
+++ b/drivers/usb/gadget/function/f_midi.c
@@ -85,6 +85,7 @@ struct f_midi {
 	int index;
 	char *id;
 	unsigned int buflen, qlen;
+	bool in_ep_enabled;
 };
 
 static inline struct f_midi *func_to_midi(struct usb_function *f)
@@ -331,6 +332,7 @@ static int f_midi_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
 	if (err)
 		return err;
 
+	midi->in_ep_enabled = true;
 	err = f_midi_start_ep(midi, f, midi->out_ep);
 	if (err)
 		return err;
@@ -366,6 +368,7 @@ static int f_midi_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
 		if (err) {
 			ERROR(midi, "%s queue req: %d\n",
 				    midi->out_ep->name, err);
+			free_ep_req(midi->out_ep, req);
 		}
 	}
 
@@ -385,6 +388,8 @@ static void f_midi_disable(struct usb_function *f)
 	 */
 	usb_ep_disable(midi->in_ep);
 	usb_ep_disable(midi->out_ep);
+
+	midi->in_ep_enabled = false;
 }
 
 static void f_midi_unbind(struct usb_configuration *c, struct usb_function *f)
@@ -564,7 +569,7 @@ static void f_midi_transmit(struct f_midi *midi, struct usb_request *req)
 		}
 	}
 
-	if (req->length > 0)
+	if ((req->length > 0) && (midi->in_ep_enabled))
 		usb_ep_queue(ep, req, GFP_ATOMIC);
 	else
 		free_ep_req(ep, req);
@@ -683,8 +688,9 @@ static int f_midi_register_card(struct f_midi *midi)
 
 	/* Set up rawmidi */
 	snd_component_add(card, "MIDI");
+	/* rawmidi OUTPUT = USB IN, and rawmidi INPUT = USB OUT. */
 	err = snd_rawmidi_new(card, card->longname, 0,
-			      midi->out_ports, midi->in_ports, &rmidi);
+			      midi->in_ports, midi->out_ports, &rmidi);
 	if (err < 0) {
 		ERROR(midi, "snd_rawmidi_new() failed: error %d\n", err);
 		goto fail;
@@ -790,9 +796,13 @@ f_midi_bind(struct usb_configuration *c, struct usb_function *f)
 	midi_function[i++] = (struct usb_descriptor_header *) &ms_interface_desc;
 
 	/* calculate the header's wTotalLength */
+//	n = USB_DT_MS_HEADER_SIZE
+//		+ (midi->in_ports + midi->out_ports) *
+//			(USB_DT_MIDI_IN_SIZE + USB_DT_MIDI_OUT_SIZE(1));
 	n = USB_DT_MS_HEADER_SIZE
-		+ (midi->in_ports + midi->out_ports) *
-			(USB_DT_MIDI_IN_SIZE + USB_DT_MIDI_OUT_SIZE(1));
+		+ (midi->in_ports + midi->out_ports) * (USB_DT_MIDI_IN_SIZE + USB_DT_MIDI_OUT_SIZE(1))
+		+ (sizeof(bulk_in_desc) + sizeof(bulk_out_desc))
+		+ USB_DT_MS_ENDPOINT_SIZE(midi->out_ports) + USB_DT_MS_ENDPOINT_SIZE(midi->in_ports);
 	ms_header_desc.wTotalLength = cpu_to_le16(n);
 
 	midi_function[i++] = (struct usb_descriptor_header *) &ms_header_desc;
@@ -854,11 +864,11 @@ f_midi_bind(struct usb_configuration *c, struct usb_function *f)
 	}
 
 	/* configure the endpoint descriptors ... */
-	ms_out_desc.bLength = USB_DT_MS_ENDPOINT_SIZE(midi->in_ports);
-	ms_out_desc.bNumEmbMIDIJack = midi->in_ports;
+	ms_out_desc.bLength = USB_DT_MS_ENDPOINT_SIZE(midi->out_ports);
+	ms_out_desc.bNumEmbMIDIJack = midi->out_ports;
 
-	ms_in_desc.bLength = USB_DT_MS_ENDPOINT_SIZE(midi->out_ports);
-	ms_in_desc.bNumEmbMIDIJack = midi->out_ports;
+	ms_in_desc.bLength = USB_DT_MS_ENDPOINT_SIZE(midi->in_ports);
+	ms_in_desc.bNumEmbMIDIJack = midi->in_ports;
 
 	/* ... and add them to the list */
 	midi_function[i++] = (struct usb_descriptor_header *) &bulk_out_desc;
@@ -952,6 +962,12 @@ int __init f_midi_bind_config(struct usb_configuration *c,
 	midi->gadget = c->cdev->gadget;
 	tasklet_init(&midi->tasklet, f_midi_in_tasklet, (unsigned long) midi);
 
+	midi->id = kstrdup(id, GFP_KERNEL);
+	midi->index = index;
+	midi->buflen = buflen;
+	midi->qlen = qlen;
+	midi->in_ep_enabled = false;
+
 	/* set up ALSA midi devices */
 	midi->in_ports = in_ports;
 	midi->out_ports = out_ports;
@@ -966,11 +982,6 @@ int __init f_midi_bind_config(struct usb_configuration *c,
 	midi->func.set_alt     = f_midi_set_alt;
 	midi->func.disable     = f_midi_disable;
 
-	midi->id = kstrdup(id, GFP_KERNEL);
-	midi->index = index;
-	midi->buflen = buflen;
-	midi->qlen = qlen;
-
 	status = usb_add_function(c, &midi->func);
 	if (status)
 		goto setup_fail;
diff --git a/drivers/usb/gadget/legacy/gmidi.c b/drivers/usb/gadget/legacy/gmidi.c
index 2710f2982..f50671419 100644
--- a/drivers/usb/gadget/legacy/gmidi.c
+++ b/drivers/usb/gadget/legacy/gmidi.c
@@ -73,6 +73,26 @@ static unsigned int out_ports = 1;
 module_param(out_ports, uint, S_IRUGO);
 MODULE_PARM_DESC(out_ports, "Number of MIDI output ports");
 
+static unsigned int config_attr = 0;
+module_param(config_attr, uint, S_IRUGO);
+MODULE_PARM_DESC(config_attr, "Attributes of MIDI configuration");
+
+static unsigned int vendor_id = 0;
+module_param(vendor_id, uint, S_IRUGO);
+MODULE_PARM_DESC(vendor_id, "Vendor number of driver");
+
+static unsigned int product_id = 0;
+module_param(product_id, uint, S_IRUGO);
+MODULE_PARM_DESC(product_id, "Product number of driver");
+
+static const char* vendor_name = NULL;
+module_param(vendor_name, charp, S_IRUGO);
+MODULE_PARM_DESC(vendor_name, "Vendor name of driver");
+
+static const char* product_name = NULL;
+module_param(product_name, charp, S_IRUGO);
+MODULE_PARM_DESC(product_name, "Product name of driver");
+
 /* Thanks to Grey Innovation for donating this product ID.
  *
  * DO NOT REUSE THESE IDs with a protocol-incompatible driver!!  Ever!!
@@ -97,9 +117,12 @@ static struct usb_device_descriptor device_desc = {
 	.bNumConfigurations =	1,
 };
 
+static char gadget_manufacture_idx[32] = "Gray Innovation";
+static char gadget_product_idx[32] = "MIDI Gadget";
+
 static struct usb_string strings_dev[] = {
-	[USB_GADGET_MANUFACTURER_IDX].s	= "Grey Innovation",
-	[USB_GADGET_PRODUCT_IDX].s	= "MIDI Gadget",
+	[USB_GADGET_MANUFACTURER_IDX].s	= gadget_manufacture_idx,
+	[USB_GADGET_PRODUCT_IDX].s	= gadget_product_idx,
 	[USB_GADGET_SERIAL_IDX].s	= "",
 	[STRING_DESCRIPTION_IDX].s	= "MIDI",
 	{  } /* end of list */
@@ -165,6 +188,19 @@ static __refdata struct usb_composite_driver midi_driver = {
 
 static int __init midi_init(void)
 {
+	// struct usb_configuration midi_config
+	if (config_attr) { midi_config.bmAttributes = config_attr; }
+
+	// struct usb_device_descriptor device_desc
+	if (vendor_id)  { device_desc.idVendor  = cpu_to_le16(vendor_id);  }
+	if (product_id) { device_desc.idProduct = cpu_to_le16(product_id); }
+
+	// struct usb_string strings_dev[USB_GADGET_MANUFACTURER_IDX].s
+	if (vendor_name) { strncpy(gadget_manufacture_idx, vendor_name, sizeof(gadget_manufacture_idx)-1); }
+
+	// struct usb_string strings_dev[USB_GADGET_PRODUCT_IDX].s
+	if (product_name) { strncpy(gadget_product_idx, product_name, sizeof(gadget_product_idx)-1); }
+
 	return usb_composite_probe(&midi_driver);
 }
 module_init(midi_init);
diff --git a/drivers/usb/gadget/legacy/mass_storage.c b/drivers/usb/gadget/legacy/mass_storage.c
index 8e27a8c96..db167cd39 100644
--- a/drivers/usb/gadget/legacy/mass_storage.c
+++ b/drivers/usb/gadget/legacy/mass_storage.c
@@ -34,17 +34,15 @@
 
 /*-------------------------------------------------------------------------*/
 
-#define DRIVER_DESC		"Mass Storage Gadget"
-#define DRIVER_VERSION		"2009/09/11"
+#define DRIVER_DESC		"Digital Workstation"
+#define DRIVER_VERSION		"2017/01/01"
 
 /*
- * Thanks to NetChip Technologies for donating this product ID.
- *
  * DO NOT REUSE THESE IDs with any other driver!!  Ever!!
  * Instead:  allocate your own, using normal USB-IF procedures.
  */
-#define FSG_VENDOR_ID	0x0525	/* NetChip */
-#define FSG_PRODUCT_ID	0xa4a5	/* Linux-USB File-backed Storage Gadget */
+#define FSG_VENDOR_ID	0x0499	/* Yamaha Corporation	*/
+#define FSG_PRODUCT_ID	0x1403	/* USB Mass Storage */
 
 #include "f_mass_storage.h"
 
@@ -81,7 +79,7 @@ static const struct usb_descriptor_header *otg_desc[] = {
 };
 
 static struct usb_string strings_dev[] = {
-	[USB_GADGET_MANUFACTURER_IDX].s = "",
+	[USB_GADGET_MANUFACTURER_IDX].s = "Yamaha Corporation",
 	[USB_GADGET_PRODUCT_IDX].s = DRIVER_DESC,
 	[USB_GADGET_SERIAL_IDX].s = "",
 	{  } /* end of list */
