diff options
author | Sudip Mukherjee <sudipm.mukherjee@gmail.com> | 2015-09-22 18:54:29 +0530 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2015-10-01 12:40:20 -0500 |
commit | f349dd3c76039a2b0bf03a11484dd2850868b7e3 (patch) | |
tree | 625300c218ab09b0802fe7e847819b3b935781b7 /drivers/usb/gadget | |
parent | 2e1b7d0c691c63c66d5bf5c097243f3b037adf32 (diff) | |
download | lwn-f349dd3c76039a2b0bf03a11484dd2850868b7e3.tar.gz lwn-f349dd3c76039a2b0bf03a11484dd2850868b7e3.zip |
usb: gadget: amd5536udc: use free_dma_pools
We have the function free_dma_pools() which frees all the dma pools. Use
it instead of calling all the functions separately. The if conditions
for data_requests and stp_requests are also not required here as this is
the remove function and we are here means probe has succeeded and dma
has been successfully allocated, so they cannot be NULL here.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/udc/amd5536udc.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/drivers/usb/gadget/udc/amd5536udc.c b/drivers/usb/gadget/udc/amd5536udc.c index 6223b1be029f..7805b29bf101 100644 --- a/drivers/usb/gadget/udc/amd5536udc.c +++ b/drivers/usb/gadget/udc/amd5536udc.c @@ -3131,20 +3131,7 @@ static void udc_pci_remove(struct pci_dev *pdev) return; /* dma pool cleanup */ - if (dev->data_requests) - pci_pool_destroy(dev->data_requests); - - if (dev->stp_requests) { - /* cleanup DMA desc's for ep0in */ - pci_pool_free(dev->stp_requests, - dev->ep[UDC_EP0OUT_IX].td_stp, - dev->ep[UDC_EP0OUT_IX].td_stp_dma); - pci_pool_free(dev->stp_requests, - dev->ep[UDC_EP0OUT_IX].td, - dev->ep[UDC_EP0OUT_IX].td_phys); - - pci_pool_destroy(dev->stp_requests); - } + free_dma_pools(dev); /* reset controller */ writel(AMD_BIT(UDC_DEVCFG_SOFTRESET), &dev->regs->cfg); |