Commit 8b05cefc authored by Becky Bruce's avatar Becky Bruce Committed by Kumar Gala

cpm_uart: Pass actual dev ptr to dma_* in ucc and cpm_uart serial

We're currently passing NULL, and really shouldn't be.
Signed-off-by: default avatarBecky Bruce <becky.bruce@freescale.com>
Acked-By: default avatarTimur Tabi <timur@freescale.com>
Signed-off-by: default avatarKumar Gala <galak@kernel.crashing.org>
parent b38fd42f
...@@ -1333,6 +1333,9 @@ static int __devinit cpm_uart_probe(struct of_device *ofdev, ...@@ -1333,6 +1333,9 @@ static int __devinit cpm_uart_probe(struct of_device *ofdev,
if (ret) if (ret)
return ret; return ret;
/* initialize the device pointer for the port */
pinfo->port.dev = &ofdev->dev;
return uart_add_one_port(&cpm_reg, &pinfo->port); return uart_add_one_port(&cpm_reg, &pinfo->port);
} }
......
...@@ -100,7 +100,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con) ...@@ -100,7 +100,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con)
mem_addr = (u8 *) cpm_dpram_addr(cpm_dpalloc(memsz, 8)); mem_addr = (u8 *) cpm_dpram_addr(cpm_dpalloc(memsz, 8));
dma_addr = (u32)cpm_dpram_phys(mem_addr); dma_addr = (u32)cpm_dpram_phys(mem_addr);
} else } else
mem_addr = dma_alloc_coherent(NULL, memsz, &dma_addr, mem_addr = dma_alloc_coherent(pinfo->port.dev, memsz, &dma_addr,
GFP_KERNEL); GFP_KERNEL);
if (mem_addr == NULL) { if (mem_addr == NULL) {
...@@ -127,7 +127,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con) ...@@ -127,7 +127,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con)
void cpm_uart_freebuf(struct uart_cpm_port *pinfo) void cpm_uart_freebuf(struct uart_cpm_port *pinfo)
{ {
dma_free_coherent(NULL, L1_CACHE_ALIGN(pinfo->rx_nrfifos * dma_free_coherent(pinfo->port.dev, L1_CACHE_ALIGN(pinfo->rx_nrfifos *
pinfo->rx_fifosize) + pinfo->rx_fifosize) +
L1_CACHE_ALIGN(pinfo->tx_nrfifos * L1_CACHE_ALIGN(pinfo->tx_nrfifos *
pinfo->tx_fifosize), pinfo->mem_addr, pinfo->tx_fifosize), pinfo->mem_addr,
......
...@@ -136,7 +136,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con) ...@@ -136,7 +136,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con)
dma_addr = virt_to_bus(mem_addr); dma_addr = virt_to_bus(mem_addr);
} }
else else
mem_addr = dma_alloc_coherent(NULL, memsz, &dma_addr, mem_addr = dma_alloc_coherent(pinfo->port.dev, memsz, &dma_addr,
GFP_KERNEL); GFP_KERNEL);
if (mem_addr == NULL) { if (mem_addr == NULL) {
...@@ -163,7 +163,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con) ...@@ -163,7 +163,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con)
void cpm_uart_freebuf(struct uart_cpm_port *pinfo) void cpm_uart_freebuf(struct uart_cpm_port *pinfo)
{ {
dma_free_coherent(NULL, L1_CACHE_ALIGN(pinfo->rx_nrfifos * dma_free_coherent(pinfo->port.dev, L1_CACHE_ALIGN(pinfo->rx_nrfifos *
pinfo->rx_fifosize) + pinfo->rx_fifosize) +
L1_CACHE_ALIGN(pinfo->tx_nrfifos * L1_CACHE_ALIGN(pinfo->tx_nrfifos *
pinfo->tx_fifosize), (void __force *)pinfo->mem_addr, pinfo->tx_fifosize), (void __force *)pinfo->mem_addr,
......
...@@ -1009,7 +1009,7 @@ static int qe_uart_request_port(struct uart_port *port) ...@@ -1009,7 +1009,7 @@ static int qe_uart_request_port(struct uart_port *port)
rx_size = L1_CACHE_ALIGN(qe_port->rx_nrfifos * qe_port->rx_fifosize); rx_size = L1_CACHE_ALIGN(qe_port->rx_nrfifos * qe_port->rx_fifosize);
tx_size = L1_CACHE_ALIGN(qe_port->tx_nrfifos * qe_port->tx_fifosize); tx_size = L1_CACHE_ALIGN(qe_port->tx_nrfifos * qe_port->tx_fifosize);
bd_virt = dma_alloc_coherent(NULL, rx_size + tx_size, &bd_dma_addr, bd_virt = dma_alloc_coherent(port->dev, rx_size + tx_size, &bd_dma_addr,
GFP_KERNEL); GFP_KERNEL);
if (!bd_virt) { if (!bd_virt) {
dev_err(port->dev, "could not allocate buffer descriptors\n"); dev_err(port->dev, "could not allocate buffer descriptors\n");
...@@ -1051,7 +1051,7 @@ static void qe_uart_release_port(struct uart_port *port) ...@@ -1051,7 +1051,7 @@ static void qe_uart_release_port(struct uart_port *port)
container_of(port, struct uart_qe_port, port); container_of(port, struct uart_qe_port, port);
struct ucc_slow_private *uccs = qe_port->us_private; struct ucc_slow_private *uccs = qe_port->us_private;
dma_free_coherent(NULL, qe_port->bd_size, qe_port->bd_virt, dma_free_coherent(port->dev, qe_port->bd_size, qe_port->bd_virt,
qe_port->bd_dma_addr); qe_port->bd_dma_addr);
ucc_slow_free(uccs); ucc_slow_free(uccs);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment