patch-2.3.42 linux/drivers/usb/printer.c

Next file: linux/drivers/usb/scanner.c
Previous file: linux/drivers/usb/ov511.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.41/linux/drivers/usb/printer.c linux/drivers/usb/printer.c
@@ -125,15 +125,15 @@
 	if (status & LP_PERRORP) {
 	
 		if (status & LP_POUTPA) {
-			printk(KERN_INFO "usblp%d: out of paper", usblp->minor);
+			info("usblp%d: out of paper", usblp->minor);
 			return -ENOSPC;
 		}
 		if (~status & LP_PSELECD) {
-			printk(KERN_INFO "usblp%d: off-line", usblp->minor);
+			info("usblp%d: off-line", usblp->minor);
 			return -EIO;
 		}
 		if (~status & LP_PERRORP) {
-			printk(KERN_INFO "usblp%d: on fire", usblp->minor);
+			info("usblp%d: on fire", usblp->minor);
 			return -EIO;
 		}
 	}
@@ -229,18 +229,19 @@
 
 		if (usblp->writeurb.status == -EINPROGRESS) {
 			usb_unlink_urb(&usblp->writeurb);
-			printk(KERN_ERR "usblp%d: timed out\n", usblp->minor);
+			err("usblp%d: timed out", usblp->minor);
 			return -EIO;
 		}
 
 		if (!usblp->dev)
 			return -ENODEV;
 
-		if (!usblp->writeurb.status)
+		if (!usblp->writeurb.status) {
 			writecount += usblp->writeurb.transfer_buffer_length;
-		else {
+			usblp->writeurb.transfer_buffer_length = 0;
+		} else {
 			if (!(retval = usblp_check_status(usblp))) {
-				printk(KERN_ERR "usblp%d: error %d writing to printer\n",
+				err("usblp%d: error %d writing to printer",
 					usblp->minor, usblp->writeurb.status);
 				return -EIO;
 			}
@@ -287,7 +288,7 @@
 		return -ENODEV;
 
 	if (usblp->readurb.status) {
-		printk(KERN_ERR "usblp%d: error %d reading from printer\n",
+		err("usblp%d: error %d reading from printer",
 			usblp->minor, usblp->readurb.status);
 		usb_submit_urb(&usblp->readurb);
 		return -EIO;
@@ -389,7 +390,7 @@
 			buf + USBLP_BUF_SIZE, USBLP_BUF_SIZE, usblp_bulk, usblp);
 	}
 
-	printk(KERN_INFO "usblp%d: USB %sdirectional printer dev %d if %d alt %d\n",
+	info("usblp%d: USB %sdirectional printer dev %d if %d alt %d",
 		minor, bidir ? "Bi" : "Uni", dev->devnum, ifnum, alts);
 
 	return usblp_table[minor] = usblp;

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