From a401d431a2333441c187bd76e50c9eba29a35c8a Mon Sep 17 00:00:00 2001 From: wlf Date: Tue, 25 Feb 2014 18:05:27 +0800 Subject: [PATCH] USB: fix bug in dwc_otg_pcd_remove --- drivers/usb/dwc_otg/dwc_otg_pcd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/usb/dwc_otg/dwc_otg_pcd.c b/drivers/usb/dwc_otg/dwc_otg_pcd.c index de81406162b9..92926df0180e 100755 --- a/drivers/usb/dwc_otg/dwc_otg_pcd.c +++ b/drivers/usb/dwc_otg/dwc_otg_pcd.c @@ -2077,8 +2077,7 @@ void dwc_otg_pcd_remove( struct device *dev ) pcd->driver->driver.name); usb_gadget_unregister_driver( pcd->driver); } - device_unregister(&pcd->gadget.dev); - + usb_del_gadget_udc(&pcd->gadget); if (GET_CORE_IF(pcd)->dma_enable) { dma_free_coherent (NULL, sizeof (*pcd->setup_pkt) * 5, pcd->setup_pkt, pcd->setup_pkt_dma_handle); -- 2.34.1