arm: use a dummy struct device for ISA DMA use of the DMA API
authorChristoph Hellwig <hch@lst.de>
Fri, 21 Dec 2018 13:56:38 +0000 (14:56 +0100)
committerChristoph Hellwig <hch@lst.de>
Mon, 8 Apr 2019 15:52:45 +0000 (17:52 +0200)
This gets rid of the last NULL dev argument passed to the DMA API.

Signed-off-by: Christoph Hellwig <hch@lst.de>
arch/arm/kernel/dma-isa.c
arch/arm/mach-rpc/dma.c

index 84363fe7bad26b5696e291f8f7ab2a0ae0963214..10c45cc6b9572c1e03d0b7a299b195c542fc24c5 100644 (file)
@@ -55,6 +55,12 @@ static int isa_get_dma_residue(unsigned int chan, dma_t *dma)
        return chan < 4 ? count : (count << 1);
 }
 
+static struct device isa_dma_dev = {
+       .init_name              = "fallback device",
+       .coherent_dma_mask      = ~(dma_addr_t)0,
+       .dma_mask               = &isa_dma_dev.coherent_dma_mask,
+};
+
 static void isa_enable_dma(unsigned int chan, dma_t *dma)
 {
        if (dma->invalid) {
@@ -89,7 +95,7 @@ static void isa_enable_dma(unsigned int chan, dma_t *dma)
                        dma->sg = &dma->buf;
                        dma->sgcount = 1;
                        dma->buf.length = dma->count;
-                       dma->buf.dma_address = dma_map_single(NULL,
+                       dma->buf.dma_address = dma_map_single(&isa_dma_dev,
                                dma->addr, dma->count,
                                direction);
                }
index fb48f3141fb4d7cd2403aaece876ae338a308bf2..f2703ca17954636b059d651a1ebf78c03bfde2dc 100644 (file)
@@ -151,6 +151,12 @@ static void iomd_free_dma(unsigned int chan, dma_t *dma)
        free_irq(idma->irq, idma);
 }
 
+static struct device isa_dma_dev = {
+       .init_name              = "fallback device",
+       .coherent_dma_mask      = ~(dma_addr_t)0,
+       .dma_mask               = &isa_dma_dev.coherent_dma_mask,
+};
+
 static void iomd_enable_dma(unsigned int chan, dma_t *dma)
 {
        struct iomd_dma *idma = container_of(dma, struct iomd_dma, dma);
@@ -168,7 +174,7 @@ static void iomd_enable_dma(unsigned int chan, dma_t *dma)
                        idma->dma.sg = &idma->dma.buf;
                        idma->dma.sgcount = 1;
                        idma->dma.buf.length = idma->dma.count;
-                       idma->dma.buf.dma_address = dma_map_single(NULL,
+                       idma->dma.buf.dma_address = dma_map_single(&isa_dma_dev,
                                idma->dma.addr, idma->dma.count,
                                idma->dma.dma_mode == DMA_MODE_READ ?
                                DMA_FROM_DEVICE : DMA_TO_DEVICE);