linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Pass actual dev ptr to dma_* in ucc and cpm_uart serial
@ 2008-09-08 19:20 Becky Bruce
  2008-09-08 19:56 ` Scott Wood
  0 siblings, 1 reply; 5+ messages in thread
From: Becky Bruce @ 2008-09-08 19:20 UTC (permalink / raw)
  To: linuxppc-dev

We're currently passing NULL, and really shouldn't be.

Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
---
 drivers/serial/cpm_uart/cpm_uart_cpm2.c |    6 +++---
 drivers/serial/ucc_uart.c               |    4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm2.c b/drivers/serial/cpm_uart/cpm_uart_cpm2.c
index b8db4d3..141c0a3 100644
--- a/drivers/serial/cpm_uart/cpm_uart_cpm2.c
+++ b/drivers/serial/cpm_uart/cpm_uart_cpm2.c
@@ -136,7 +136,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con)
 		dma_addr = virt_to_bus(mem_addr);
 	}
 	else
-		mem_addr = dma_alloc_coherent(NULL, memsz, &dma_addr,
+		mem_addr = dma_alloc_coherent(pinfo->port.dev, memsz, &dma_addr,
 					      GFP_KERNEL);
 
 	if (mem_addr == NULL) {
@@ -163,8 +163,8 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con)
 
 void cpm_uart_freebuf(struct uart_cpm_port *pinfo)
 {
-	dma_free_coherent(NULL, L1_CACHE_ALIGN(pinfo->rx_nrfifos *
-					       pinfo->rx_fifosize) +
+	dma_free_coherent(pinfo->port.dev, L1_CACHE_ALIGN(pinfo->rx_nrfifos *
+							  pinfo->rx_fifosize) +
 			  L1_CACHE_ALIGN(pinfo->tx_nrfifos *
 					 pinfo->tx_fifosize), (void __force *)pinfo->mem_addr,
 			  pinfo->dma_addr);
diff --git a/drivers/serial/ucc_uart.c b/drivers/serial/ucc_uart.c
index 5c5d18d..539c933 100644
--- a/drivers/serial/ucc_uart.c
+++ b/drivers/serial/ucc_uart.c
@@ -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);
 	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);
 	if (!bd_virt) {
 		dev_err(port->dev, "could not allocate buffer descriptors\n");
@@ -1051,7 +1051,7 @@ static void qe_uart_release_port(struct uart_port *port)
 		container_of(port, struct uart_qe_port, port);
 	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);
 
 	ucc_slow_free(uccs);
-- 
1.5.5.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] Pass actual dev ptr to dma_* in ucc and cpm_uart serial
  2008-09-08 19:20 [PATCH] Pass actual dev ptr to dma_* in ucc and cpm_uart serial Becky Bruce
@ 2008-09-08 19:56 ` Scott Wood
  2008-09-09 14:22   ` Becky Bruce
  2008-09-09 18:25   ` Timur Tabi
  0 siblings, 2 replies; 5+ messages in thread
From: Scott Wood @ 2008-09-08 19:56 UTC (permalink / raw)
  To: Becky Bruce; +Cc: linuxppc-dev

Becky Bruce wrote:
> We're currently passing NULL, and really shouldn't be.

This patch doesn't change that for cpm2, since port.dev is never 
initialized. :-P

> Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
> ---
>  drivers/serial/cpm_uart/cpm_uart_cpm2.c |    6 +++---
>  drivers/serial/ucc_uart.c               |    4 ++--
>  2 files changed, 5 insertions(+), 5 deletions(-)

cpm_uart_cpm1.c has the same problem.

-Scott

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Pass actual dev ptr to dma_* in ucc and cpm_uart serial
  2008-09-08 19:56 ` Scott Wood
@ 2008-09-09 14:22   ` Becky Bruce
  2008-09-09 18:25   ` Timur Tabi
  1 sibling, 0 replies; 5+ messages in thread
From: Becky Bruce @ 2008-09-09 14:22 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev


On Sep 8, 2008, at 2:56 PM, Scott Wood wrote:

> Becky Bruce wrote:
>> We're currently passing NULL, and really shouldn't be.
>
> This patch doesn't change that for cpm2, since port.dev is never  
> initialized. :-P
>
>> Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
>> ---
>> drivers/serial/cpm_uart/cpm_uart_cpm2.c |    6 +++---
>> drivers/serial/ucc_uart.c               |    4 ++--
>> 2 files changed, 5 insertions(+), 5 deletions(-)
>
> cpm_uart_cpm1.c has the same problem.
>
> -Scott

Good catch, thanks!  Will respin.

Cheers,
B

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Pass actual dev ptr to dma_* in ucc and cpm_uart serial
  2008-09-08 19:56 ` Scott Wood
  2008-09-09 14:22   ` Becky Bruce
@ 2008-09-09 18:25   ` Timur Tabi
  2008-09-09 21:04     ` Scott Wood
  1 sibling, 1 reply; 5+ messages in thread
From: Timur Tabi @ 2008-09-09 18:25 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev

On Mon, Sep 8, 2008 at 2:56 PM, Scott Wood <scottwood@freescale.com> wrote:

> This patch doesn't change that for cpm2, since port.dev is never
> initialized. :-P

I don't initialize port->dev in the UCC UART driver, but it's still
non-zero, so why isn't it initialized in the CPM UART driver?

(P.S. Becky - please CC: me on any UCC UART or QE LIB patches)

-- 
Timur Tabi
Linux kernel developer at Freescale

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Pass actual dev ptr to dma_* in ucc and cpm_uart serial
  2008-09-09 18:25   ` Timur Tabi
@ 2008-09-09 21:04     ` Scott Wood
  0 siblings, 0 replies; 5+ messages in thread
From: Scott Wood @ 2008-09-09 21:04 UTC (permalink / raw)
  To: Timur Tabi; +Cc: linuxppc-dev

Timur Tabi wrote:
> On Mon, Sep 8, 2008 at 2:56 PM, Scott Wood <scottwood@freescale.com> wrote:
> 
>> This patch doesn't change that for cpm2, since port.dev is never
>> initialized. :-P
> 
> I don't initialize port->dev in the UCC UART driver, 

Yes you do -- check line 1403.

-Scott

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-09-09 21:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-08 19:20 [PATCH] Pass actual dev ptr to dma_* in ucc and cpm_uart serial Becky Bruce
2008-09-08 19:56 ` Scott Wood
2008-09-09 14:22   ` Becky Bruce
2008-09-09 18:25   ` Timur Tabi
2008-09-09 21:04     ` Scott Wood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).