Commit 00e0aaa7 authored by Sebastian Andrzej Siewior's avatar Sebastian Andrzej Siewior Committed by Greg Kroah-Hartman

usb: musb: core: Call dma_controller_destroy() in error path only once.

commit 8d1aad74 upstream.

In commit f3ce4d5b ("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: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bfb4a262
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment