patch-2.1.56 linux/drivers/pnp/parport_probe.c

Next file: linux/drivers/scsi/Config.in
Previous file: linux/drivers/net/x25_asy.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.55/linux/drivers/pnp/parport_probe.c linux/drivers/pnp/parport_probe.c
@@ -84,13 +84,13 @@
 	return count; 
 }
 
-static struct wait_queue *wait_q = NULL;
+static struct wait_queue *wait_q;
 
 static void wakeup(void *ref)
 {
 	struct pardevice **dev = (struct pardevice **)ref;
 	
-	if (!wait_q || parport_claim(*dev))
+	if (!waitqueue_active || parport_claim(*dev))
 		return;
 
 	wake_up(&wait_q);
@@ -108,10 +108,9 @@
 		return -EINVAL;
 	}
 
-	if (parport_claim(dev)) {
+	init_waitqueue (&wait_q);
+	if (parport_claim(dev))
 		sleep_on(&wait_q);
-		wait_q = NULL;
-	}
 
 	switch (parport_ieee1284_nibble_mode_ok(port, 4)) {
 	case 1:

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