Skip to content

Commit c7bbc43

Browse files
committed
Merge tag 'usb-serial-6.19-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-next
Johan writes: USB serial updates for 6.19-rc1 Here are the USB serial updates for 6.19-rc1: - fix belkin_sa and kobil_sct TIOCMBIS and TIOCMBIC ioctls - match on interface number for dual-port ftdi devices with reserved jtag port - do not log reserved ftdi jtag ports on probe - apply ftdi_sio NDI quirk remapping 19200 bps consistently - drop ftdi_sio NDI quirk module parameter - clean up ftdi_sio quirk implementations - add more modem device ids Included are also various clean ups. All have been in linux-next with no reported issues. * tag 'usb-serial-6.19-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial: USB: serial: option: move Telit 0x10c7 composition in the right place USB: serial: option: add Telit Cinterion FE910C04 new compositions USB: serial: option: add Foxconn T99W760 USB: serial: ftdi_sio: drop NDI quirk module parameter USB: serial: ftdi_sio: clean up NDI speed hack USB: serial: ftdi_sio: enable NDI speed hack consistently USB: serial: ftdi_sio: rename quirk symbols USB: serial: ftdi_sio: clean up quirk comments USB: serial: ftdi_sio: rewrite 8u2232c quirk USB: serial: ftdi_sio: silence jtag probe USB: serial: ftdi_sio: match on interface number for jtag USB: serial: kobil_sct: drop unnecessary initialisations USB: serial: kobil_sct: clean up set_termios() USB: serial: kobil_sct: add control request helpers USB: serial: kobil_sct: clean up device type checks USB: serial: kobil_sct: clean up tiocmset() USB: serial: belkin_sa: clean up tiocmset() USB: serial: kobil_sct: fix TIOCMBIS and TIOCMBIC USB: serial: belkin_sa: fix TIOCMBIS and TIOCMBIC
2 parents 2b7a0f4 + 072f2c4 commit c7bbc43

4 files changed

Lines changed: 182 additions & 292 deletions

File tree

drivers/usb/serial/belkin_sa.c

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -435,43 +435,39 @@ static int belkin_sa_tiocmset(struct tty_struct *tty,
435435
struct belkin_sa_private *priv = usb_get_serial_port_data(port);
436436
unsigned long control_state;
437437
unsigned long flags;
438-
int retval;
439-
int rts = 0;
440-
int dtr = 0;
438+
int retval = 0;
441439

442440
spin_lock_irqsave(&priv->lock, flags);
443441
control_state = priv->control_state;
444442

445-
if (set & TIOCM_RTS) {
443+
if (set & TIOCM_RTS)
446444
control_state |= TIOCM_RTS;
447-
rts = 1;
448-
}
449-
if (set & TIOCM_DTR) {
445+
if (set & TIOCM_DTR)
450446
control_state |= TIOCM_DTR;
451-
dtr = 1;
452-
}
453-
if (clear & TIOCM_RTS) {
447+
if (clear & TIOCM_RTS)
454448
control_state &= ~TIOCM_RTS;
455-
rts = 0;
456-
}
457-
if (clear & TIOCM_DTR) {
449+
if (clear & TIOCM_DTR)
458450
control_state &= ~TIOCM_DTR;
459-
dtr = 0;
460-
}
461451

462452
priv->control_state = control_state;
463453
spin_unlock_irqrestore(&priv->lock, flags);
464454

465-
retval = BSA_USB_CMD(BELKIN_SA_SET_RTS_REQUEST, rts);
466-
if (retval < 0) {
467-
dev_err(&port->dev, "Set RTS error %d\n", retval);
468-
goto exit;
455+
if ((set | clear) & TIOCM_RTS) {
456+
retval = BSA_USB_CMD(BELKIN_SA_SET_RTS_REQUEST,
457+
!!(control_state & TIOCM_RTS));
458+
if (retval < 0) {
459+
dev_err(&port->dev, "Set RTS error %d\n", retval);
460+
goto exit;
461+
}
469462
}
470463

471-
retval = BSA_USB_CMD(BELKIN_SA_SET_DTR_REQUEST, dtr);
472-
if (retval < 0) {
473-
dev_err(&port->dev, "Set DTR error %d\n", retval);
474-
goto exit;
464+
if ((set | clear) & TIOCM_DTR) {
465+
retval = BSA_USB_CMD(BELKIN_SA_SET_DTR_REQUEST,
466+
!!(control_state & TIOCM_DTR));
467+
if (retval < 0) {
468+
dev_err(&port->dev, "Set DTR error %d\n", retval);
469+
goto exit;
470+
}
475471
}
476472
exit:
477473
return retval;

0 commit comments

Comments
 (0)