summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2011-03-31 12:57:13 +1100
committerStephen Rothwell <sfr@canb.auug.org.au>2011-03-31 12:57:13 +1100
commit338bd4a8e58ccf8af8a9aee2ffde0816e5b3363a (patch)
treed2a0913c76c9f9d8d4d9d02d03cc247540a66111
parent65933b18c9f2f11d2f5b7b7ffc3b1844295048fb (diff)
Revert "sparc32, leon: APBUART driver must use archdata to get IRQ number"
This reverts commit 10544f128c338aeb7f63c002ad7eee67aa0e6acf.
-rw-r--r--drivers/tty/serial/apbuart.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/tty/serial/apbuart.c b/drivers/tty/serial/apbuart.c
index 12d4e7ca53ca..1ab999b04ef3 100644
--- a/drivers/tty/serial/apbuart.c
+++ b/drivers/tty/serial/apbuart.c
@@ -555,9 +555,10 @@ static struct uart_driver grlib_apbuart_driver = {
static int __devinit apbuart_probe(struct platform_device *op)
{
- int i;
+ int i = -1;
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;
@@ -565,7 +566,6 @@ 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 *ampopts;
+ const int *irqs, *ampopts;
const struct amba_prom_registers *regs;
struct uart_port *port;
unsigned long addr;
@@ -623,9 +623,11 @@ 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 (!regs)
+ if (!irqs || !regs)
continue;
grlib_apbuart_nodes[line] = np;
@@ -636,7 +638,7 @@ static int grlib_apbuart_configure(void)
port->mapbase = addr;
port->membase = ioremap(addr, sizeof(struct grlib_apbuart_regs_map));
- port->irq = 0;
+ port->irq = *irqs;
port->iotype = UPIO_MEM;
port->ops = &grlib_apbuart_ops;
port->flags = UPF_BOOT_AUTOCONF;