patch-2.4.0-test4 linux/drivers/block/paride/paride.c

Next file: linux/drivers/block/paride/pg.c
Previous file: linux/drivers/block/md.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test3/linux/drivers/block/paride/paride.c linux/drivers/block/paride/paride.c
@@ -13,10 +13,11 @@
 	1.02	GRG 1998.05.05  init_proto, release_proto, ktti
 	1.03	GRG 1998.08.15  eliminate compiler warning
 	1.04    GRG 1998.11.28  added support for FRIQ 
-
+	1.05    TMW 2000.06.06  use parport_find_number instead of
+				parport_enumerate
 */
 
-#define PI_VERSION      "1.04"
+#define PI_VERSION      "1.05"
 
 #include <linux/module.h>
 #include <linux/config.h>
@@ -238,22 +239,25 @@
 {
 #ifdef CONFIG_PARPORT
 
-	struct parport	*pp;
-
-	pp = parport_enumerate();
+	struct parport *port;
 
-	while((pp)&&(pp->base != pi->port)) pp = pp->next;
+	port = parport_find_base (pi->port);
+	if (!port) return;
 
-	if (!pp) return;
+	pi->pardev = parport_register_device(port,
+					     pi->device,NULL,
+					     pi_wake_up,NULL,
+					     0,(void *)pi);
+	parport_put_port (port);
+	if (!pi->pardev) return;
 
-	pi->pardev = (void *) parport_register_device(
-	      pp,pi->device,NULL,pi_wake_up,NULL,0,(void *)pi);
 
 	init_waitqueue_head(&pi->parq);
 
-	if (verbose) printk("%s: 0x%x is %s\n",pi->device,pi->port,pp->name);
+	if (verbose) printk("%s: 0x%x is %s\n",pi->device,pi->port,
+			    port->name);
 	
-	pi->parname = (char *)pp->name;
+	pi->parname = (char *)port->name;
 
 #endif
 }
@@ -406,6 +410,7 @@
 {	int k;
 
 	for (k=0;k<MAX_PROTOS;k++) protocols[k] = 0;
+
 	printk("paride: version %s installed\n",PI_VERSION);
 	return 0;
 }

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