patch-2.1.36 linux/drivers/char/lp.c

Next file: linux/drivers/char/lp_m68k.c
Previous file: linux/drivers/char/keyboard.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.35/linux/drivers/char/lp.c linux/drivers/char/lp.c
@@ -23,6 +23,7 @@
 #include <linux/ioport.h>
 #include <linux/fcntl.h>
 #include <linux/delay.h>
+#include <linux/init.h>
 
 #include <asm/io.h>
 #include <asm/uaccess.h>
@@ -678,7 +679,7 @@
 	return 0;
 }
 
-int lp_init(void)
+__initfunc(int lp_init(void))
 {
 	int count = 0;
 	struct parport *pb;
@@ -693,24 +694,27 @@
 	pb = parport_enumerate();
 
 	while (pb) {
-		if (parport[0] == -1 || lp_searchfor(parport, count) ||
-		    (parport[0] == -3 &&
-		     pb->probe_info.class == PARPORT_CLASS_PRINTER)) {
-			lp_table[count].dev =
-			    parport_register_device(pb, dev_name, NULL, 
-					    lp_wakeup,
-					    lp_interrupt, PARPORT_DEV_TRAN,
-					    (void *) &lp_table[count]);
-			lp_table[count].flags |= LP_EXIST;
-			printk(KERN_INFO "lp%d: using %s at 0x%x, ", count,
-			       pb->name, pb->base);
-			if (pb->irq == -1)
-				printk("polling.\n");
-			else
-				printk("irq %d.\n", pb->irq);
+		/* We only understand PC-style ports. */
+		if (pb->modes & PARPORT_MODE_SPP) {
+			if (parport[0] == -1 || lp_searchfor(parport, count) ||
+			    (parport[0] == -3 &&
+			     pb->probe_info.class == PARPORT_CLASS_PRINTER)) {
+				lp_table[count].dev =
+				  parport_register_device(pb, dev_name, NULL, 
+						lp_wakeup,
+						lp_interrupt, PARPORT_DEV_TRAN,
+						(void *) &lp_table[count]);
+				lp_table[count].flags |= LP_EXIST;
+				printk(KERN_INFO "lp%d: using %s at 0x%x, ", 
+				       count, pb->name, pb->base);
+				if (pb->irq == -1)
+					printk("polling.\n");
+				else
+					printk("irq %d.\n", pb->irq);
+			}
+			if (++count == LP_NO)
+				break;
 		}
-		if (++count == LP_NO)
-			break;
 		pb = pb->next;
   	}
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov