summaryrefslogtreecommitdiff
path: root/drivers/usb/musb
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2013-10-16 10:50:07 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-01-09 20:25:08 (GMT)
commit00e0aaa745c90725c28fe1b374d054a94d5682f2 (patch)
treedb6e7f790cf45355c8f0df4e37a81d7a3de616a2 /drivers/usb/musb
parentbfb4a262bf2ce2b8f7d4f444eb00059b3078bf64 (diff)
downloadlinux-fsl-qoriq-00e0aaa745c90725c28fe1b374d054a94d5682f2.tar.xz
usb: musb: core: Call dma_controller_destroy() in error path only once.
commit 8d1aad7485e653c2c5fd985b326096f680f7d918 upstream. In commit f3ce4d5 ("usb: musb: core: call dma_controller_destroy() in the err path") I erroneously assumed that the dma controller is not removed in the error patch. This was wrong because it happens later via musb_free(). That means the original commit can be reverted because it is wrong or we do this, so it is more obvious. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/musb')
-rw-r--r--drivers/usb/musb/musb_core.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 0d0d118..8934b8d 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -1810,8 +1810,6 @@ static void musb_free(struct musb *musb)
free_irq(musb->nIrq, musb);
}
cancel_work_sync(&musb->irq_work);
- if (musb->dma_controller)
- dma_controller_destroy(musb->dma_controller);
musb_host_free(musb);
}
@@ -2036,6 +2034,9 @@ static int musb_remove(struct platform_device *pdev)
musb_exit_debugfs(musb);
musb_shutdown(pdev);
+ if (musb->dma_controller)
+ dma_controller_destroy(musb->dma_controller);
+
musb_free(musb);
device_init_wakeup(dev, 0);
return 0;