usb: gadget: Add proper cleanup of disabled endpoints
Clear driver_data after disabling endpoints
to prevent shortage of endpoints and failures
on their reallocation.
Change-Id: I2dc74799d440b2e1d5e53fc0f89decbce494d6ec
Signed-off-by: Anna Perel <aperel@codeaurora.org>
diff --git a/drivers/usb/gadget/u_bam.c b/drivers/usb/gadget/u_bam.c
index 13965de..1369f4f 100644
--- a/drivers/usb/gadget/u_bam.c
+++ b/drivers/usb/gadget/u_bam.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, Code Aurora Forum. All rights reserved.
+/* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -652,6 +652,8 @@
usb_ep_disable(port->gr->out);
usb_ep_disable(port->gr->in);
+ port->gr->in->driver_data = NULL;
+ port->gr->out->driver_data = NULL;
}
static void gbam_connect_work(struct work_struct *w)