aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/musb/musb_gadget.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
index 4376f51f5ef1..696e9e0b05af 100644
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
@@ -76,13 +76,21 @@ static inline void map_dma_buffer(struct musb_request *request,
76 return; 76 return;
77 77
78 if (request->request.dma == DMA_ADDR_INVALID) { 78 if (request->request.dma == DMA_ADDR_INVALID) {
79 request->request.dma = dma_map_single( 79 dma_addr_t dma_addr;
80 int ret;
81
82 dma_addr = dma_map_single(
80 musb->controller, 83 musb->controller,
81 request->request.buf, 84 request->request.buf,
82 request->request.length, 85 request->request.length,
83 request->tx 86 request->tx
84 ? DMA_TO_DEVICE 87 ? DMA_TO_DEVICE
85 : DMA_FROM_DEVICE); 88 : DMA_FROM_DEVICE);
89 ret = dma_mapping_error(musb->controller, dma_addr);
90 if (ret)
91 return;
92
93 request->request.dma = dma_addr;
86 request->map_state = MUSB_MAPPED; 94 request->map_state = MUSB_MAPPED;
87 } else { 95 } else {
88 dma_sync_single_for_device(musb->controller, 96 dma_sync_single_for_device(musb->controller,