aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-powerpc/parport.h
diff options
context:
space:
mode:
authorMichael Neuling <mikey@neuling.org>2006-01-10 20:08:56 -0500
committerPaul Mackerras <paulus@samba.org>2006-01-10 22:49:24 -0500
commit193cac99f6d8604aca71e5a966a8cd1dfb84819d (patch)
tree1e2cca9d04fd495b0b7f538ab19fca6e4328c759 /include/asm-powerpc/parport.h
parent296167ae1799815b9ed2d135a847436502f2ee91 (diff)
[PATCH] powerpc: parallel port init fix
This stops parport from accessing nonexistent parallel ports. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include/asm-powerpc/parport.h')
-rw-r--r--include/asm-powerpc/parport.h28
1 files changed, 26 insertions, 2 deletions
diff --git a/include/asm-powerpc/parport.h b/include/asm-powerpc/parport.h
index 897e49a88a6b..3fca21ddf546 100644
--- a/include/asm-powerpc/parport.h
+++ b/include/asm-powerpc/parport.h
@@ -10,10 +10,34 @@
10#define _ASM_POWERPC_PARPORT_H 10#define _ASM_POWERPC_PARPORT_H
11#ifdef __KERNEL__ 11#ifdef __KERNEL__
12 12
13static int __devinit parport_pc_find_isa_ports (int autoirq, int autodma); 13#include <asm/prom.h>
14
15extern struct parport *parport_pc_probe_port (unsigned long int base,
16 unsigned long int base_hi,
17 int irq, int dma,
18 struct pci_dev *dev);
19
14static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma) 20static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma)
15{ 21{
16 return parport_pc_find_isa_ports (autoirq, autodma); 22 struct device_node *np;
23 u32 *prop;
24 u32 io1, io2;
25 int propsize;
26 int count = 0;
27 for (np = NULL; (np = of_find_compatible_node(np,
28 "parallel",
29 "pnpPNP,400")) != NULL;) {
30 prop = (u32 *)get_property(np, "reg", &propsize);
31 if (!prop || propsize > 6*sizeof(u32))
32 continue;
33 io1 = prop[1]; io2 = prop[2];
34 prop = (u32 *)get_property(np, "interrupts", NULL);
35 if (!prop)
36 continue;
37 if (parport_pc_probe_port(io1, io2, prop[0], autodma, NULL) != NULL)
38 count++;
39 }
40 return count;
17} 41}
18 42
19#endif /* __KERNEL__ */ 43#endif /* __KERNEL__ */