{
int dpmemsz, memsz;
u8 *dp_mem;
- uint dp_addr;
+ uint dp_offset;
u8 *mem_addr;
- dma_addr_t dma_addr;
+ dma_addr_t dma_addr = 0;
pr_debug("CPM uart[%d]:allocbuf\n", pinfo->port.line);
dpmemsz = sizeof(cbd_t) * (pinfo->rx_nrfifos + pinfo->tx_nrfifos);
- dp_mem = m8xx_cpm_dpalloc(dpmemsz);
- if (dp_mem == NULL) {
+ dp_offset = cpm_dpalloc(dpmemsz, 8);
+ if (IS_DPERR(dp_offset)) {
printk(KERN_ERR
"cpm_uart_cpm1.c: could not allocate buffer descriptors\n");
return -ENOMEM;
}
- dp_addr = m8xx_cpm_dpram_offset(dp_mem);
+ dp_mem = cpm_dpram_addr(dp_offset);
memsz = L1_CACHE_ALIGN(pinfo->rx_nrfifos * pinfo->rx_fifosize) +
L1_CACHE_ALIGN(pinfo->tx_nrfifos * pinfo->tx_fifosize);
GFP_KERNEL);
if (mem_addr == NULL) {
- m8xx_cpm_dpfree(dp_mem);
+ cpm_dpfree(dp_offset);
printk(KERN_ERR
"cpm_uart_cpm1.c: could not allocate coherent memory\n");
return -ENOMEM;
}
- pinfo->dp_addr = dp_addr;
+ pinfo->dp_addr = dp_offset;
pinfo->mem_addr = mem_addr;
pinfo->dma_addr = dma_addr;
pinfo->tx_fifosize), pinfo->mem_addr,
pinfo->dma_addr);
- m8xx_cpm_dpfree(m8xx_cpm_dpram_addr(pinfo->dp_addr));
+ cpm_dpfree(pinfo->dp_addr);
}
/* Setup any dynamic params in the uart desc */