if (wait == 0) {
dev_dbg(&qt_port->port->dev, "%s - TIMEOUT", __func__);
return;
- } else {
- wait = 30;
}
+ wait = 30;
}
}
struct usb_serial_port *port = tty->driver_data;
struct quatech_port *qt_port = qt_get_port_private(port);
unsigned int index;
+ char diff;
dev_dbg(&port->dev, "%s cmd 0x%04x\n", __func__, cmd);
#endif
if (signal_pending(current))
return -ERESTARTSYS;
- else {
- char diff = qt_port->diff_status;
-
- if (diff == 0)
- return -EIO; /* no change => error */
-
- /* Consume all events */
- qt_port->diff_status = 0;
-
- if (((arg & TIOCM_RNG)
- && (diff & SERIAL_MSR_RI))
- || ((arg & TIOCM_DSR)
- && (diff & SERIAL_MSR_DSR))
- || ((arg & TIOCM_CD)
- && (diff & SERIAL_MSR_CD))
- || ((arg & TIOCM_CTS)
- && (diff & SERIAL_MSR_CTS))) {
- return 0;
- }
+
+ diff = qt_port->diff_status;
+
+ if (diff == 0)
+ return -EIO; /* no change => error */
+
+ /* Consume all events */
+ qt_port->diff_status = 0;
+
+ if (((arg & TIOCM_RNG)
+ && (diff & SERIAL_MSR_RI))
+ || ((arg & TIOCM_DSR)
+ && (diff & SERIAL_MSR_DSR))
+ || ((arg & TIOCM_CD)
+ && (diff & SERIAL_MSR_CD))
+ || ((arg & TIOCM_CTS)
+ && (diff & SERIAL_MSR_CTS))) {
+ return 0;
}
}
return 0;
box_set_register(port->serial, index, MODEM_CONTROL_REGISTER, mcr);
if (status < 0)
return -ESPIPE;
- else
- return 0;
+
+ return 0;
}
static int qt_tiocmget(struct tty_struct *tty)