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>
This commit is contained in:
parent
02c486f483
commit
5ab6a91a1c
|
@ -55,6 +55,12 @@ static int isa_get_dma_residue(unsigned int chan, dma_t *dma)
|
||||||
return chan < 4 ? count : (count << 1);
|
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)
|
static void isa_enable_dma(unsigned int chan, dma_t *dma)
|
||||||
{
|
{
|
||||||
if (dma->invalid) {
|
if (dma->invalid) {
|
||||||
|
@ -89,7 +95,7 @@ static void isa_enable_dma(unsigned int chan, dma_t *dma)
|
||||||
dma->sg = &dma->buf;
|
dma->sg = &dma->buf;
|
||||||
dma->sgcount = 1;
|
dma->sgcount = 1;
|
||||||
dma->buf.length = dma->count;
|
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,
|
dma->addr, dma->count,
|
||||||
direction);
|
direction);
|
||||||
}
|
}
|
||||||
|
|
|
@ -151,6 +151,12 @@ static void iomd_free_dma(unsigned int chan, dma_t *dma)
|
||||||
free_irq(idma->irq, idma);
|
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)
|
static void iomd_enable_dma(unsigned int chan, dma_t *dma)
|
||||||
{
|
{
|
||||||
struct iomd_dma *idma = container_of(dma, struct iomd_dma, 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.sg = &idma->dma.buf;
|
||||||
idma->dma.sgcount = 1;
|
idma->dma.sgcount = 1;
|
||||||
idma->dma.buf.length = idma->dma.count;
|
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.addr, idma->dma.count,
|
||||||
idma->dma.dma_mode == DMA_MODE_READ ?
|
idma->dma.dma_mode == DMA_MODE_READ ?
|
||||||
DMA_FROM_DEVICE : DMA_TO_DEVICE);
|
DMA_FROM_DEVICE : DMA_TO_DEVICE);
|
||||||
|
|
Loading…
Reference in New Issue