[PATCH 6/8] apbh: Use dma_alloc_coherent() to get DMA address

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Avoid converting virtual address to physical by simple casting by
making use of the fact that dma_alloc_coherent() can already return
that information to us.

Signed-off-by: Andrey Smirnov <andrew.smirnov@xxxxxxxxx>
---
 drivers/dma/apbh_dma.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/apbh_dma.c b/drivers/dma/apbh_dma.c
index 15a523ac8..3bee89f78 100644
--- a/drivers/dma/apbh_dma.c
+++ b/drivers/dma/apbh_dma.c
@@ -381,14 +381,15 @@ static int mxs_dma_release(int channel)
 struct mxs_dma_desc *mxs_dma_desc_alloc(void)
 {
 	struct mxs_dma_desc *pdesc;
+	dma_addr_t dma_address;
 
 	pdesc = dma_alloc_coherent(sizeof(struct mxs_dma_desc),
-				   DMA_ADDRESS_BROKEN);
+				   &dma_address);
 
 	if (pdesc == NULL)
 		return NULL;
 
-	pdesc->address = (dma_addr_t)pdesc;
+	pdesc->address = dma_address;
 
 	return pdesc;
 };
-- 
2.21.0


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux