This is a similar issue as the one I just addressed in ftdi_sio.c. I
didn't like the warning trace being generated by urb.c, when the
usb_unlink_urb() has been used for synchronous removal of the port read
URB. I am just wondering, why are the read URB's being removed
synchronously and the others are not?

The rest of the patch is just a cleanup. All the 'NULL' checks are not
necessary.

-------------------------------------------------------------------
--- linux-2.6.9-rc1-mm1/drivers/usb/serial/usb-serial.c 2004-09-08 04:51:23.000000000 
+0200
+++ linux-2.6.9-rc1-mm1-ccs/drivers/usb/serial/usb-serial.c     2004-09-08 
15:31:11.000000000 +0200
@@ -14,6 +14,14 @@
  *
  * See Documentation/usb/usb-serial.txt for more information on using this driver
  *
+ * (09/08/2004) Jan Capek
+ *       destroy_serial(), port_release() - removed test on URB's being NULL as
+ *       these checks are always performed by underlying usb_kill_urb(),
+ *       usb_unlink_urb, usb_free_urb() resp. Further, port->read_urb is now
+ *       removed synchronously using usb_kill_urb() instead of usb_unlink_urb().
+ *       This is to ensure consistency with the urb.c, so that usb_unlink_urb()
+ *       is not used for synchronous unlinking anymore.
+ *
  * (12/10/2002) gkh
  *     Split the ports off into their own struct device, and added a
  *     usb-serial bus driver.
@@ -454,18 +462,15 @@
                        port = serial->port[i];
                        if (!port)
                                continue;
-                       if (port->read_urb) {
-                               usb_unlink_urb(port->read_urb);
-                               usb_free_urb(port->read_urb);
-                       }
-                       if (port->write_urb) {
-                               usb_unlink_urb(port->write_urb);
-                               usb_free_urb(port->write_urb);
-                       }
-                       if (port->interrupt_in_urb) {
-                               usb_unlink_urb(port->interrupt_in_urb);
-                               usb_free_urb(port->interrupt_in_urb);
-                       }
+                       usb_kill_urb(port->read_urb);
+                       usb_free_urb(port->read_urb);
+
+                       usb_unlink_urb(port->write_urb);
+                       usb_free_urb(port->write_urb);
+
+                       usb_unlink_urb(port->interrupt_in_urb);
+                       usb_free_urb(port->interrupt_in_urb);
+
                        kfree(port->bulk_in_buffer);
                        kfree(port->bulk_out_buffer);
                        kfree(port->interrupt_in_buffer);
@@ -818,18 +823,16 @@
        struct usb_serial_port *port = to_usb_serial_port(dev);

        dbg ("%s - %s", __FUNCTION__, dev->bus_id);
-       if (port->read_urb) {
-               usb_unlink_urb(port->read_urb);
-               usb_free_urb(port->read_urb);
-       }
-       if (port->write_urb) {
-               usb_unlink_urb(port->write_urb);
-               usb_free_urb(port->write_urb);
-       }
-       if (port->interrupt_in_urb) {
-               usb_unlink_urb(port->interrupt_in_urb);
-               usb_free_urb(port->interrupt_in_urb);
-       }
+
+       usb_kill_urb(port->read_urb);
+       usb_free_urb(port->read_urb);
+
+       usb_unlink_urb(port->write_urb);
+       usb_free_urb(port->write_urb);
+
+       usb_unlink_urb(port->interrupt_in_urb);
+       usb_free_urb(port->interrupt_in_urb);
+
        kfree(port->bulk_in_buffer);
        kfree(port->bulk_out_buffer);
        kfree(port->interrupt_in_buffer);
----------------------------------------------------------------

Thanks,

Jan


Jan Capek - CCS Inc.
Firmware developer



-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to