aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ehci-mem.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host/ehci-mem.c')
-rw-r--r--drivers/usb/host/ehci-mem.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/usb/host/ehci-mem.c b/drivers/usb/host/ehci-mem.c
index 5cff6bace5e5..bdb29e618058 100644
--- a/drivers/usb/host/ehci-mem.c
+++ b/drivers/usb/host/ehci-mem.c
@@ -27,7 +27,7 @@
27 * need to use dma_pool or dma_alloc_coherent 27 * need to use dma_pool or dma_alloc_coherent
28 * - driver buffers, read/written by HC ... single shot DMA mapped 28 * - driver buffers, read/written by HC ... single shot DMA mapped
29 * 29 *
30 * There's also PCI "register" data, which is memory mapped. 30 * There's also "register" data (e.g. PCI or SOC), which is memory mapped.
31 * No memory seen by this driver is pageable. 31 * No memory seen by this driver is pageable.
32 */ 32 */
33 33
@@ -35,13 +35,14 @@
35 35
36/* Allocate the key transfer structures from the previously allocated pool */ 36/* Allocate the key transfer structures from the previously allocated pool */
37 37
38static inline void ehci_qtd_init (struct ehci_qtd *qtd, dma_addr_t dma) 38static inline void ehci_qtd_init(struct ehci_hcd *ehci, struct ehci_qtd *qtd,
39 dma_addr_t dma)
39{ 40{
40 memset (qtd, 0, sizeof *qtd); 41 memset (qtd, 0, sizeof *qtd);
41 qtd->qtd_dma = dma; 42 qtd->qtd_dma = dma;
42 qtd->hw_token = cpu_to_le32 (QTD_STS_HALT); 43 qtd->hw_token = cpu_to_le32 (QTD_STS_HALT);
43 qtd->hw_next = EHCI_LIST_END; 44 qtd->hw_next = EHCI_LIST_END(ehci);
44 qtd->hw_alt_next = EHCI_LIST_END; 45 qtd->hw_alt_next = EHCI_LIST_END(ehci);
45 INIT_LIST_HEAD (&qtd->qtd_list); 46 INIT_LIST_HEAD (&qtd->qtd_list);
46} 47}
47 48
@@ -52,7 +53,7 @@ static struct ehci_qtd *ehci_qtd_alloc (struct ehci_hcd *ehci, gfp_t flags)
52 53
53 qtd = dma_pool_alloc (ehci->qtd_pool, flags, &dma); 54 qtd = dma_pool_alloc (ehci->qtd_pool, flags, &dma);
54 if (qtd != NULL) { 55 if (qtd != NULL) {
55 ehci_qtd_init (qtd, dma); 56 ehci_qtd_init(ehci, qtd, dma);
56 } 57 }
57 return qtd; 58 return qtd;
58} 59}
@@ -220,7 +221,7 @@ static int ehci_mem_init (struct ehci_hcd *ehci, gfp_t flags)
220 goto fail; 221 goto fail;
221 } 222 }
222 for (i = 0; i < ehci->periodic_size; i++) 223 for (i = 0; i < ehci->periodic_size; i++)
223 ehci->periodic [i] = EHCI_LIST_END; 224 ehci->periodic [i] = EHCI_LIST_END(ehci);
224 225
225 /* software shadow of hardware table */ 226 /* software shadow of hardware table */
226 ehci->pshadow = kcalloc(ehci->periodic_size, sizeof(void *), flags); 227 ehci->pshadow = kcalloc(ehci->periodic_size, sizeof(void *), flags);