diff options
author | Greg Kroah-Hartman | 2013-10-24 17:18:40 +0200 |
---|---|---|
committer | Greg Kroah-Hartman | 2013-10-24 17:18:40 +0200 |
commit | 5328f35b1584a9849ffe46afa42018946aa43851 (patch) | |
tree | f939d0577ae13ed22069ac4188ce21bacc7a3af5 /drivers/usb/musb/musb_core.c | |
parent | phy: exynos-mipi-video: Fix phy_power_off() callback (diff) | |
parent | usb: phy: twl6030-usb: Include linux/of.h header (diff) | |
download | kernel-qcow2-linux-5328f35b1584a9849ffe46afa42018946aa43851.tar.gz kernel-qcow2-linux-5328f35b1584a9849ffe46afa42018946aa43851.tar.xz kernel-qcow2-linux-5328f35b1584a9849ffe46afa42018946aa43851.zip |
Merge tag 'usb-for-v3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next
Felipe writes:
usb: patches for v3.13
Final conversions to configfs for mass storage, acm_ms, and
multi gadgets.
MUSB should now work out of the box on AM335x-based boards
(beagle bone white and black) with DMA thanks to Sebastian's
work.
We can now enable VERBOSE_DEBUG on builds of drivers/usb/gadget/
by selecting CONFIG_USB_GADGET_VERBOSE.
s3c-hsotg got quite a few non-critical fixes but also learned
a few new tricks (isochronous transfers, multi count support).
The Marvel USB3 Controller driver got a memory leak fix.
devm_usb_get_phy() learned not to return NULL, ever.
Other than these patches, we have the usual set of cleanups
ranging from removal of unnecessary *_set_drvdata() to using
SIMPLE_DEV_PM_OPS.
Signed-of-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/musb/musb_core.c')
-rw-r--r-- | drivers/usb/musb/musb_core.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 208785e36d52..0a43329569d1 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -1809,8 +1809,7 @@ static void musb_free(struct musb *musb) disable_irq_wake(musb->nIrq); free_irq(musb->nIrq, musb); } - if (musb->dma_controller) - dma_controller_destroy(musb->dma_controller); + cancel_work_sync(&musb->irq_work); musb_host_free(musb); } @@ -1885,8 +1884,13 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) pm_runtime_get_sync(musb->controller); - if (use_dma && dev->dma_mask) + if (use_dma && dev->dma_mask) { musb->dma_controller = dma_controller_create(musb, musb->mregs); + if (IS_ERR(musb->dma_controller)) { + status = PTR_ERR(musb->dma_controller); + goto fail2_5; + } + } /* be sure interrupts are disabled before connecting ISR */ musb_platform_disable(musb); @@ -1946,6 +1950,8 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) if (status < 0) goto fail3; status = musb_gadget_setup(musb); + if (status) + musb_host_cleanup(musb); break; default: dev_err(dev, "unsupported port mode %d\n", musb->port_mode); @@ -1972,10 +1978,12 @@ fail5: fail4: musb_gadget_cleanup(musb); + musb_host_cleanup(musb); fail3: if (musb->dma_controller) dma_controller_destroy(musb->dma_controller); +fail2_5: pm_runtime_put_sync(musb->controller); fail2: @@ -2032,6 +2040,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; |