diff options
author | Martyn Welch <martyn.welch@ge.com> | 2010-04-26 18:50:21 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2010-05-06 02:49:26 -0400 |
commit | 7cad19784950f947bf8b332b92d83c75788f897a (patch) | |
tree | d422d2de6b680b0c5c10ac3cab04bd9062d06707 /arch/powerpc | |
parent | 75c1d539ea13117cbe95e2c343e52af67d735145 (diff) |
powerpc: Correct parport interrupt parsing
Currently the parsing of the device tree in
arch/powerpc/include/asm/parport.h assumes that the interrupt provided in
the parallel port node is a valid virtual irq. The values for the
interrupts provided in the device tree should have meaning in the context
of the driver for the specific interrupt controller to which the interrupt
is connected and irq_of_parse_and_map() should be used to determine the
correct virtual irq.
Signed-off-by: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/include/asm/parport.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/arch/powerpc/include/asm/parport.h b/arch/powerpc/include/asm/parport.h index 94942d60ddf..1ca1102b4a2 100644 --- a/arch/powerpc/include/asm/parport.h +++ b/arch/powerpc/include/asm/parport.h | |||
@@ -19,6 +19,8 @@ static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma) | |||
19 | u32 io1, io2; | 19 | u32 io1, io2; |
20 | int propsize; | 20 | int propsize; |
21 | int count = 0; | 21 | int count = 0; |
22 | int virq; | ||
23 | |||
22 | for (np = NULL; (np = of_find_compatible_node(np, | 24 | for (np = NULL; (np = of_find_compatible_node(np, |
23 | "parallel", | 25 | "parallel", |
24 | "pnpPNP,400")) != NULL;) { | 26 | "pnpPNP,400")) != NULL;) { |
@@ -26,10 +28,13 @@ static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma) | |||
26 | if (!prop || propsize > 6*sizeof(u32)) | 28 | if (!prop || propsize > 6*sizeof(u32)) |
27 | continue; | 29 | continue; |
28 | io1 = prop[1]; io2 = prop[2]; | 30 | io1 = prop[1]; io2 = prop[2]; |
29 | prop = of_get_property(np, "interrupts", NULL); | 31 | |
30 | if (!prop) | 32 | virq = irq_of_parse_and_map(np, 0); |
33 | if (virq == NO_IRQ) | ||
31 | continue; | 34 | continue; |
32 | if (parport_pc_probe_port(io1, io2, prop[0], autodma, NULL, 0) != NULL) | 35 | |
36 | if (parport_pc_probe_port(io1, io2, virq, autodma, NULL, 0) | ||
37 | != NULL) | ||
33 | count++; | 38 | count++; |
34 | } | 39 | } |
35 | return count; | 40 | return count; |