aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/udc-core.c
diff options
context:
space:
mode:
authorKishon Vijay Abraham I <kishon@ti.com>2012-03-21 12:04:30 -0400
committerFelipe Balbi <balbi@ti.com>2012-04-10 12:11:49 -0400
commit8ae8090c82eb407267001f75b3d256b3bd4ae691 (patch)
tree48fc0cf66f6ccb87b0955ce83431181d85534031 /drivers/usb/gadget/udc-core.c
parent3006dc8c627d738693e910c159630e4368c9e86c (diff)
usb: gadget: udc-core: fix asymmetric calls in remove_driver
During modprobe of gadget driver, pullup is called after udc_start. In order to make the exit path symmetric when removing a gadget driver, call pullup before ->udc_stop. This is needed to avoid issues with PM where udc_stop disables the module completely (put IP in reset state, cut functional and interface clocks, and so on), which prevents us from accessing the IP's address space, thus creating the possibility of an abort exception when we try to access IP's address space after clocks are off. Cc: stable@vger.kernel.org Signed-off-by: Partha Basak <p-basak2@ti.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget/udc-core.c')
-rw-r--r--drivers/usb/gadget/udc-core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/gadget/udc-core.c b/drivers/usb/gadget/udc-core.c
index c261887e05ae..2fa9865babed 100644
--- a/drivers/usb/gadget/udc-core.c
+++ b/drivers/usb/gadget/udc-core.c
@@ -264,8 +264,8 @@ static void usb_gadget_remove_driver(struct usb_udc *udc)
264 if (udc_is_newstyle(udc)) { 264 if (udc_is_newstyle(udc)) {
265 udc->driver->disconnect(udc->gadget); 265 udc->driver->disconnect(udc->gadget);
266 udc->driver->unbind(udc->gadget); 266 udc->driver->unbind(udc->gadget);
267 usb_gadget_udc_stop(udc->gadget, udc->driver);
268 usb_gadget_disconnect(udc->gadget); 267 usb_gadget_disconnect(udc->gadget);
268 usb_gadget_udc_stop(udc->gadget, udc->driver);
269 } else { 269 } else {
270 usb_gadget_stop(udc->gadget, udc->driver); 270 usb_gadget_stop(udc->gadget, udc->driver);
271 } 271 }