public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* USB 2.4.30: ftdi_sio
@ 2005-02-10 23:49 Pete Zaitcev
  0 siblings, 0 replies; only message in thread
From: Pete Zaitcev @ 2005-02-10 23:49 UTC (permalink / raw)
  To: marcelo.tosatti; +Cc: zaitcev, linux-kernel

Granted, this is a cleanup, and we don't like cleanups in 2.4. But I really
dislike how the comment managed to detach from the function it described.
The idiotic error message is quite annoying, too.

diff -urpN -X dontdiff linux-2.4.30-pre1/drivers/usb/serial/ftdi_sio.c linux-2.4.30-pre1-usb/drivers/usb/serial/ftdi_sio.c
--- linux-2.4.30-pre1/drivers/usb/serial/ftdi_sio.c	2005-01-25 11:17:25.000000000 -0800
+++ linux-2.4.30-pre1-usb/drivers/usb/serial/ftdi_sio.c	2005-02-10 11:18:12.000000000 -0800
@@ -737,8 +737,6 @@ static struct usb_serial_device_type ftd
 };
 
 
-
-
 static struct usb_serial_device_type ftdi_userdev_device = {
 	.owner =		THIS_MODULE,
 	.name =			"FTDI SIO compatible",
@@ -1240,15 +1238,6 @@ static int ftdi_HE_TIRA1_startup (struct
 } /* ftdi_HE_TIRA1_startup */
 
 
-/* ftdi_shutdown is called from usbserial:usb_serial_disconnect 
- *   it is called when the usb device is disconnected
- *
- *   usbserial:usb_serial_disconnect
- *      calls __serial_close for each open of the port
- *      shutdown is called then (ie ftdi_shutdown)
- */
-
-
 /* Startup for the 8U232AM chip */
 static int ftdi_userdev_startup (struct usb_serial *serial)
 {
@@ -1273,6 +1262,14 @@ static int ftdi_userdev_startup (struct 
 }
 
 
+/* ftdi_shutdown is called from usbserial:usb_serial_disconnect 
+ *   it is called when the usb device is disconnected
+ *
+ *   usbserial:usb_serial_disconnect
+ *      calls __serial_close for each open of the port
+ *      shutdown is called then (ie ftdi_shutdown)
+ */
+
 static void ftdi_shutdown (struct usb_serial *serial)
 { /* ftdi_shutdown */
 	
@@ -1382,6 +1379,7 @@ static void ftdi_close (struct usb_seria
 	struct usb_serial *serial;
 	unsigned int c_cflag = port->tty->termios->c_cflag;
 	char buf[1];
+	int err;
 
 	dbg("%s", __FUNCTION__);
 
@@ -1412,8 +1410,9 @@ static void ftdi_close (struct usb_seria
 
 		/* shutdown our bulk read */
 		if (port->read_urb) {
-			if(usb_unlink_urb (port->read_urb)<0)
-				err("Error unlinking urb");
+			err = usb_unlink_urb (port->read_urb);
+			if (err < 0 && err != -ENODEV)
+				err("Error unlinking urb (%d)", err);
 		}
 		/* unlink the running write urbs */
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-02-10 23:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-10 23:49 USB 2.4.30: ftdi_sio Pete Zaitcev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox