static void ehci_mem_cleanup (struct ehci_hcd *ehci) { if (ehci->async) qh_destroy(ehci, ehci->async); ehci->async = NULL; if (ehci->dummy) qh_destroy(ehci, ehci->dummy); ehci->dummy = NULL; /* DMA consistent memory and pools */ dma_pool_destroy(ehci->qtd_pool); ehci->qtd_pool = NULL; dma_pool_destroy(ehci->qh_pool); ehci->qh_pool = NULL; dma_pool_destroy(ehci->itd_pool); ehci->itd_pool = NULL; dma_pool_destroy(ehci->sitd_pool); ehci->sitd_pool = NULL; if (ehci->periodic) dma_free_coherent(ehci_to_hcd(ehci)->self.sysdev, ehci->periodic_size * sizeof (u32), ehci->periodic, ehci->periodic_dma); ehci->periodic = NULL; /* shadow periodic table */ kfree(ehci->pshadow); ehci->pshadow = NULL; }
static inline void qh_put (struct ehci_qh *qh) { if (!--qh->refcount) qh_destroy(qh); }