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

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

diff -u --recursive --new-file v2.0.34/linux/drivers/char/lp.c linux/drivers/char/lp.c
@@ -89,7 +89,14 @@
 	while(wait != LP_WAIT(minor)) wait++;
 	/* control port takes strobe high */
 	outb_p(( LP_PSELECP | LP_PINITP | LP_PSTROBE ), ( LP_C( minor )));
-	while(wait) wait--;
+	/* Wait until NBUSY line goes high */
+	count = 0;
+	do {
+		status = LP_S(minor);
+		count++;
+		if (need_resched)
+			schedule();
+	} while (LP_READY(minor, status) && (count<LP_CHAR(minor)));
 	/* take strobe low */
 	outb_p(( LP_PSELECP | LP_PINITP ), ( LP_C( minor )));
 	/* update waittime statistics */

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