config COMEDI_NI_LABPC_ISA
tristate "NI Lab-PC and compatibles ISA support"
select COMEDI_NI_LABPC
- select COMEDI_NI_LABPC_ISADMA if ISA_DMA_API && VIRT_TO_BUS
+ select COMEDI_NI_LABPC_ISADMA if ISA_DMA_API
---help---
Enable support for National Instruments Lab-PC and compatibles
Lab-PC-1200, Lab-PC-1200AI, Lab-PC+.
struct labpc_dma_desc {
unsigned int chan; /* DMA channel */
- u16 *virt_addr; /* virtual address of DMA buffer */
- phys_addr_t hw_addr; /* hardware (bus) address of DMA buffer */
+ void *virt_addr; /* virtual address of DMA buffer */
+ dma_addr_t hw_addr; /* hardware (bus) address of DMA buffer */
unsigned int size; /* size of DMA transfer (in bytes) */
};
if (request_dma(dma_chan, dev->board_name))
return;
- dma->virt_addr = kmalloc(dma_buffer_size, GFP_KERNEL | GFP_DMA);
+ dma->virt_addr = dma_alloc_coherent(NULL, dma_buffer_size,
+ &dma->hw_addr, GFP_KERNEL);
if (!dma->virt_addr) {
free_dma(dma_chan);
return;
}
dma->chan = dma_chan;
- dma->hw_addr = virt_to_bus(dma->virt_addr);
dma_flags = claim_dma_lock();
disable_dma(dma->chan);
struct labpc_private *devpriv = dev->private;
struct labpc_dma_desc *dma = &devpriv->dma_desc;
- kfree(dma->virt_addr);
+ if (dma->virt_addr)
+ dma_free_coherent(NULL, dma_buffer_size,
+ dma->virt_addr, dma->hw_addr);
if (dma->chan)
free_dma(dma->chan);
}