dma_unmap_single() takes the dma address, not virtual address.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
return addr;
}
-static inline void dma_unmap_single(volatile void *vaddr, size_t len,
+static inline void dma_unmap_single(dma_addr_t addr, size_t len,
enum dma_data_direction dir)
{
- unsigned long addr = (unsigned long)vaddr;
-
len = ALIGN(len, ARCH_DMA_MINALIGN);
if (dir != DMA_TO_DEVICE)
return addr;
}
-static inline void dma_unmap_single(volatile void *vaddr, size_t len,
+static inline void dma_unmap_single(dma_addr_t addr, size_t len,
enum dma_data_direction dir)
{
- unsigned long addr = (unsigned long)vaddr;
-
len = ALIGN(len, ARCH_DMA_MINALIGN);
if (dir != DMA_TO_DEVICE)
return addr;
}
-static inline void dma_unmap_single(volatile void *vaddr, size_t len,
+static inline void dma_unmap_single(dma_addr_t addr, size_t len,
enum dma_data_direction dir)
{
- unsigned long addr = (unsigned long)vaddr;
-
len = ALIGN(len, ARCH_DMA_MINALIGN);
if (dir != DMA_TO_DEVICE)
return addr;
}
-static inline void dma_unmap_single(volatile void *vaddr, size_t len,
+static inline void dma_unmap_single(dma_addr_t addr, size_t len,
enum dma_data_direction dir)
{
- unsigned long addr = (unsigned long)vaddr;
-
len = ALIGN(len, ARCH_DMA_MINALIGN);
if (dir != DMA_TO_DEVICE)
if (poll_flag == TMIO_SD_DMA_INFO1_END_RD)
udelay(1);
- dma_unmap_single(buf, len, dir);
+ dma_unmap_single(dma_addr, len, dir);
return ret;
}
iowrite32(0, denali->reg + DMA_ENABLE);
- dma_unmap_single(buf, size, dir);
+ dma_unmap_single(dma_addr, size, dir);
if (irq_status & INTR__ERASED_PAGE)
memset(buf, 0xff, size);
udelay(1);
}
- dma_unmap_single(packet, length, DMA_TO_DEVICE);
+ dma_unmap_single(paddr, length, DMA_TO_DEVICE);
if (i <= MACB_TX_TIMEOUT) {
if (ctrl & MACB_BIT(TX_UNDERRUN))
return 0;
err1:
- dma_unmap_single((void *)(uintptr_t)dwc->scratch_addr, dwc->nr_scratch *
- DWC3_SCRATCHBUF_SIZE, DMA_BIDIRECTIONAL);
+ dma_unmap_single(scratch_addr, dwc->nr_scratch * DWC3_SCRATCHBUF_SIZE,
+ DMA_BIDIRECTIONAL);
err0:
return ret;
if (!dwc->nr_scratch)
return;
- dma_unmap_single((void *)(uintptr_t)dwc->scratch_addr, dwc->nr_scratch *
+ dma_unmap_single(dwc->scratch_addr, dwc->nr_scratch *
DWC3_SCRATCHBUF_SIZE, DMA_BIDIRECTIONAL);
kfree(dwc->scratchbuf);
}
if (req->length == 0)
return;
- dma_unmap_single((void *)(uintptr_t)req->dma, req->length,
+ dma_unmap_single(req->dma, req->length,
is_in ? DMA_TO_DEVICE : DMA_FROM_DEVICE);
}
EXPORT_SYMBOL_GPL(usb_gadget_unmap_request);