module_param: make bool parameters really bool (drivers & misc)
[sfrench/cifs-2.6.git] / drivers / usb / serial / pl2303.c
index fc2d66f7f4eb0ce3410a066e3877155651398eff..3d8cda57ce7ac51ea9a3cf9aec600b55f80c8562 100644 (file)
@@ -36,7 +36,7 @@
  */
 #define DRIVER_DESC "Prolific PL2303 USB to serial adaptor driver"
 
-static int debug;
+static bool debug;
 
 #define PL2303_CLOSING_WAIT    (30*HZ)
 
@@ -502,21 +502,20 @@ static int pl2303_open(struct tty_struct *tty, struct usb_serial_port *port)
        if (tty)
                pl2303_set_termios(tty, port, &tmp_termios);
 
-       dbg("%s - submitting read urb", __func__);
-       result = usb_serial_generic_submit_read_urb(port, GFP_KERNEL);
-       if (result) {
-               pl2303_close(port);
-               return -EPROTO;
-       }
-
        dbg("%s - submitting interrupt urb", __func__);
        result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
        if (result) {
                dev_err(&port->dev, "%s - failed submitting interrupt urb,"
                        " error %d\n", __func__, result);
-               pl2303_close(port);
-               return -EPROTO;
+               return result;
        }
+
+       result = usb_serial_generic_open(tty, port);
+       if (result) {
+               usb_kill_urb(port->interrupt_in_urb);
+               return result;
+       }
+
        port->port.drain_delay = 256;
        return 0;
 }