unsigned long control_state;
unsigned long flags;
int retval = 0;
- int rts = 0;
- int dtr = 0;
spin_lock_irqsave(&priv->lock, flags);
control_state = priv->control_state;
- if (set & TIOCM_RTS) {
+ if (set & TIOCM_RTS)
control_state |= TIOCM_RTS;
- rts = 1;
- }
- if (set & TIOCM_DTR) {
+ if (set & TIOCM_DTR)
control_state |= TIOCM_DTR;
- dtr = 1;
- }
- if (clear & TIOCM_RTS) {
+ if (clear & TIOCM_RTS)
control_state &= ~TIOCM_RTS;
- rts = 1;
- }
- if (clear & TIOCM_DTR) {
+ if (clear & TIOCM_DTR)
control_state &= ~TIOCM_DTR;
- dtr = 1;
- }
priv->control_state = control_state;
spin_unlock_irqrestore(&priv->lock, flags);
- if (rts) {
+ if ((set | clear) & TIOCM_RTS) {
retval = BSA_USB_CMD(BELKIN_SA_SET_RTS_REQUEST,
!!(control_state & TIOCM_RTS));
if (retval < 0) {
}
}
- if (dtr) {
+ if ((set | clear) & TIOCM_DTR) {
retval = BSA_USB_CMD(BELKIN_SA_SET_DTR_REQUEST,
!!(control_state & TIOCM_DTR));
if (retval < 0) {