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 <[email protected]>
---
 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
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

Reply via email to