diff options
author | Christoph Hellwig <hch@lst.de> | 2018-12-21 08:56:38 -0500 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2019-04-08 11:52:45 -0400 |
commit | 5ab6a91a1cacd827382897a80425df8a2d27744a (patch) | |
tree | d51221b13cad9ddc44b4d56ab1d50299b00e9723 | |
parent | 02c486f483434286bbc775d160fa901fdb4f9ff6 (diff) |
arm: use a dummy struct device for ISA DMA use of the DMA API
This gets rid of the last NULL dev argument passed to the DMA API.
Signed-off-by: Christoph Hellwig <hch@lst.de>
-rw-r--r-- | arch/arm/kernel/dma-isa.c | 8 | ||||
-rw-r--r-- | arch/arm/mach-rpc/dma.c | 8 |
2 files changed, 14 insertions, 2 deletions
diff --git a/arch/arm/kernel/dma-isa.c b/arch/arm/kernel/dma-isa.c index 84363fe7bad2..10c45cc6b957 100644 --- a/arch/arm/kernel/dma-isa.c +++ b/arch/arm/kernel/dma-isa.c | |||
@@ -55,6 +55,12 @@ static int isa_get_dma_residue(unsigned int chan, dma_t *dma) | |||
55 | return chan < 4 ? count : (count << 1); | 55 | return chan < 4 ? count : (count << 1); |
56 | } | 56 | } |
57 | 57 | ||
58 | static struct device isa_dma_dev = { | ||
59 | .init_name = "fallback device", | ||
60 | .coherent_dma_mask = ~(dma_addr_t)0, | ||
61 | .dma_mask = &isa_dma_dev.coherent_dma_mask, | ||
62 | }; | ||
63 | |||
58 | static void isa_enable_dma(unsigned int chan, dma_t *dma) | 64 | static void isa_enable_dma(unsigned int chan, dma_t *dma) |
59 | { | 65 | { |
60 | if (dma->invalid) { | 66 | if (dma->invalid) { |
@@ -89,7 +95,7 @@ static void isa_enable_dma(unsigned int chan, dma_t *dma) | |||
89 | dma->sg = &dma->buf; | 95 | dma->sg = &dma->buf; |
90 | dma->sgcount = 1; | 96 | dma->sgcount = 1; |
91 | dma->buf.length = dma->count; | 97 | dma->buf.length = dma->count; |
92 | dma->buf.dma_address = dma_map_single(NULL, | 98 | dma->buf.dma_address = dma_map_single(&isa_dma_dev, |
93 | dma->addr, dma->count, | 99 | dma->addr, dma->count, |
94 | direction); | 100 | direction); |
95 | } | 101 | } |
diff --git a/arch/arm/mach-rpc/dma.c b/arch/arm/mach-rpc/dma.c index fb48f3141fb4..f2703ca17954 100644 --- a/arch/arm/mach-rpc/dma.c +++ b/arch/arm/mach-rpc/dma.c | |||
@@ -151,6 +151,12 @@ static void iomd_free_dma(unsigned int chan, dma_t *dma) | |||
151 | free_irq(idma->irq, idma); | 151 | free_irq(idma->irq, idma); |
152 | } | 152 | } |
153 | 153 | ||
154 | static struct device isa_dma_dev = { | ||
155 | .init_name = "fallback device", | ||
156 | .coherent_dma_mask = ~(dma_addr_t)0, | ||
157 | .dma_mask = &isa_dma_dev.coherent_dma_mask, | ||
158 | }; | ||
159 | |||
154 | static void iomd_enable_dma(unsigned int chan, dma_t *dma) | 160 | static void iomd_enable_dma(unsigned int chan, dma_t *dma) |
155 | { | 161 | { |
156 | struct iomd_dma *idma = container_of(dma, struct iomd_dma, dma); | 162 | 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) | |||
168 | idma->dma.sg = &idma->dma.buf; | 174 | idma->dma.sg = &idma->dma.buf; |
169 | idma->dma.sgcount = 1; | 175 | idma->dma.sgcount = 1; |
170 | idma->dma.buf.length = idma->dma.count; | 176 | idma->dma.buf.length = idma->dma.count; |
171 | idma->dma.buf.dma_address = dma_map_single(NULL, | 177 | idma->dma.buf.dma_address = dma_map_single(&isa_dma_dev, |
172 | idma->dma.addr, idma->dma.count, | 178 | idma->dma.addr, idma->dma.count, |
173 | idma->dma.dma_mode == DMA_MODE_READ ? | 179 | idma->dma.dma_mode == DMA_MODE_READ ? |
174 | DMA_FROM_DEVICE : DMA_TO_DEVICE); | 180 | DMA_FROM_DEVICE : DMA_TO_DEVICE); |