Patchwork [1/2,v3] sparc32,leon: APBUART driver must use archdata to get IRQ number

login
register
mail settings
Submitter Daniel Hellstrom
Date March 30, 2011, 10:31 a.m.
Message ID <1301481109-1207-1-git-send-email-daniel@gaisler.com>
Download mbox | patch
Permalink /patch/88903/
State Superseded
Delegated to: David Miller
Headers show

Comments

Daniel Hellstrom - March 30, 2011, 10:31 a.m.
See Commit id 1636f8ac2b08410df4766449f7c86b912443cd99, this
patch is similar to 19e4875fb21a69fbf620e84769a74d189c69c58d.

Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
---
 drivers/tty/serial/apbuart.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)
David Miller - March 30, 2011, 10:36 a.m.
From: Daniel Hellstrom <daniel@gaisler.com>
Date: Wed, 30 Mar 2011 12:31:48 +0200

> See Commit id 1636f8ac2b08410df4766449f7c86b912443cd99, this
> patch is similar to 19e4875fb21a69fbf620e84769a74d189c69c58d.
> 
> Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>

In Sam's feedback he asked you to refer to commits by not only
their SHA1 ID but also by their commit message header line, like
this:

	See commit 1636f8ac2b08410df4766449f7c86b912443cd99
	("sparc/of: Move of_device fields into struct pdev_archdata")

--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Daniel Hellstrom - March 30, 2011, 11:14 a.m.
David Miller wrote:

>From: Daniel Hellstrom <daniel@gaisler.com>
>Date: Wed, 30 Mar 2011 12:31:48 +0200
>
>  
>
>>See Commit id 1636f8ac2b08410df4766449f7c86b912443cd99, this
>>patch is similar to 19e4875fb21a69fbf620e84769a74d189c69c58d.
>>
>>Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
>>    
>>
>
>In Sam's feedback he asked you to refer to commits by not only
>their SHA1 ID but also by their commit message header line, like
>this:
>
>	See commit 1636f8ac2b08410df4766449f7c86b912443cd99
>	("sparc/of: Move of_device fields into struct pdev_archdata")
>
>  
>
I really screwed that up... Now I have resent the both patches.

Thanks,
Daniel

--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/tty/serial/apbuart.c b/drivers/tty/serial/apbuart.c
index 1ab999b..12d4e7c 100644
--- a/drivers/tty/serial/apbuart.c
+++ b/drivers/tty/serial/apbuart.c
@@ -555,10 +555,9 @@  static struct uart_driver grlib_apbuart_driver = {
 
 static int __devinit apbuart_probe(struct platform_device *op)
 {
-	int i = -1;
+	int i;
 	struct uart_port *port = NULL;
 
-	i = 0;
 	for (i = 0; i < grlib_apbuart_port_nr; i++) {
 		if (op->dev.of_node == grlib_apbuart_nodes[i])
 			break;
@@ -566,6 +565,7 @@  static int __devinit apbuart_probe(struct platform_device *op)
 
 	port = &grlib_apbuart_ports[i];
 	port->dev = &op->dev;
+	port->irq = op->archdata.irqs[0];
 
 	uart_add_one_port(&grlib_apbuart_driver, (struct uart_port *) port);
 
@@ -615,7 +615,7 @@  static int grlib_apbuart_configure(void)
 	freq_khz = *prop;
 
 	for_each_matching_node(np, apbuart_match) {
-		const int *irqs, *ampopts;
+		const int *ampopts;
 		const struct amba_prom_registers *regs;
 		struct uart_port *port;
 		unsigned long addr;
@@ -623,11 +623,9 @@  static int grlib_apbuart_configure(void)
 		ampopts = of_get_property(np, "ampopts", NULL);
 		if (ampopts && (*ampopts == 0))
 			continue; /* Ignore if used by another OS instance */
-
-		irqs = of_get_property(np, "interrupts", NULL);
 		regs = of_get_property(np, "reg", NULL);
 
-		if (!irqs || !regs)
+		if (!regs)
 			continue;
 
 		grlib_apbuart_nodes[line] = np;
@@ -638,7 +636,7 @@  static int grlib_apbuart_configure(void)
 
 		port->mapbase = addr;
 		port->membase = ioremap(addr, sizeof(struct grlib_apbuart_regs_map));
-		port->irq = *irqs;
+		port->irq = 0;
 		port->iotype = UPIO_MEM;
 		port->ops = &grlib_apbuart_ops;
 		port->flags = UPF_BOOT_AUTOCONF;