patch-2.3.16 linux/include/asm-arm/parport.h

Next file: linux/include/asm-arm/pgtable.h
Previous file: linux/include/asm-arm/mmu_context.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.15/linux/include/asm-arm/parport.h linux/include/asm-arm/parport.h
@@ -9,16 +9,25 @@
 #ifndef _ASM_I386_PARPORT_H
 #define _ASM_I386_PARPORT_H 1
 
+#include <linux/config.h>
+
 /* Maximum number of ports to support.  It is useless to set this greater
    than PARPORT_MAX (in <linux/parport.h>).  */
 #define PARPORT_PC_MAX_PORTS  8
 
-static int __init probe_one_port(unsigned long int base,
-				 unsigned long int base_hi,
-				 int irq, int dma);
-static int __init parport_pc_init_pci(int irq, int dma);
+/* If parport_cs (PCMCIA) is managing ports for us, we'll need the
+ * probing routines forever; otherwise we can lose them at boot time. */
+#ifdef CONFIG_PARPORT_PC_PCMCIA
+#define __maybe_initdata
+#define __maybe_init
+#else
+#define __maybe_initdata __initdata
+#define __maybe_init __init
+#endif
+
+static int __maybe_init parport_pc_init_pci(int irq, int dma);
 
-static int user_specified __initdata = 0;
+static int user_specified __maybe_initdata = 0;
 int __init
 parport_pc_init(int *io, int *io_hi, int *irq, int *dma)
 {
@@ -29,14 +38,18 @@
 		user_specified = 1;
 		do {
 			if (!*io_hi) *io_hi = 0x400 + *io;
-			count += probe_one_port(*(io++), *(io_hi++),
-						*(irq++), *(dma++));
+			if (parport_pc_probe_port(*(io++), *(io_hi++),
+						  *(irq++), *(dma++)))
+				count++;
 		} while (*io && (++i < PARPORT_PC_MAX_PORTS));
 	} else {
 		/* Probe all the likely ports. */
-		count += probe_one_port(0x3bc, 0x7bc, irq[0], dma[0]);
-		count += probe_one_port(0x378, 0x778, irq[0], dma[0]);
-		count += probe_one_port(0x278, 0x678, irq[0], dma[0]);
+		if (parport_pc_probe_port(0x3bc, 0x7bc, irq[0], dma[0]))
+			count++;
+		if (parport_pc_probe_port(0x378, 0x778, irq[0], dma[0]))
+			count++;
+		if (parport_pc_probe_port(0x278, 0x678, irq[0], dma[0]))
+			count++;
 		count += parport_pc_init_pci (irq[0], dma[0]);
 	}
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)