patch-2.4.14 linux/drivers/parport/ieee1284.c

Next file: linux/drivers/parport/ieee1284_ops.c
Previous file: linux/drivers/parport/ChangeLog
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.13/linux/drivers/parport/ieee1284.c linux/drivers/parport/ieee1284.c
@@ -119,9 +119,10 @@
 			    int usec)
 {
 	/* Zero return code is success, >0 is timeout. */
-	int counter = usec / 5;
+	int count = usec / 5 + 2;
+	int i;
 	unsigned char status;
-	for (; counter > 0; counter--) {
+	for (i = 0; i < count; i++) {
 		status = parport_read_status (port);
 		if ((status & mask) == result)
 			return 0;
@@ -129,7 +130,8 @@
 			return -EINTR;
 		if (current->need_resched)
 			break;
-		udelay (5);
+		if (i >= 2)
+			udelay (5);
 	}
 
 	return 1;

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