patch-2.3.43 linux/drivers/usb/acm.c

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

diff -u --recursive --new-file v2.3.42/linux/drivers/usb/acm.c linux/drivers/usb/acm.c
@@ -223,21 +223,25 @@
 
 	if (!ACM_READY(acm)) return;
 
+	if (urb->status)
+		dbg("nonzero read bulk status received: %d", urb->status);
+
 	if (!urb->status & !acm->throttle)  {
 		for (i = 0; i < urb->actual_length && !acm->throttle; i++)
 			tty_insert_flip_char(tty, data[i], 0);
 		tty_flip_buffer_push(tty);
-	} else
-		dbg("nonzero read bulk status received: %d", urb->status);
+	}
 
-	if (!acm->throttle) {
-		urb->actual_length = 0;
-		if (usb_submit_urb(urb))
-			dbg("failed resubmitting read urb");
-	} else {
+	if (acm->throttle) {
 		memmove(data, data + i, urb->actual_length - i);
 		urb->actual_length -= i;
+		return;
 	}
+
+	urb->actual_length = 0;
+
+	if (usb_submit_urb(urb))
+		dbg("failed resubmitting read urb");
 }
 
 static void acm_write_bulk(struct urb *urb)

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