Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: cdc-acm: use CDC serial-state defines

Use the new CDC serial-state defines.

Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20220725075841.1187-5-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Johan Hovold and committed by
Greg Kroah-Hartman
7333c87f 3fb975e6

+12 -25
+12 -12
drivers/usb/class/cdc-acm.c
··· 311 311 dev_dbg(&acm->control->dev, 312 312 "%s - serial state: 0x%x\n", __func__, newctrl); 313 313 314 - if (!acm->clocal && (acm->ctrlin & ~newctrl & ACM_CTRL_DCD)) { 314 + if (!acm->clocal && (acm->ctrlin & ~newctrl & USB_CDC_SERIAL_STATE_DCD)) { 315 315 dev_dbg(&acm->control->dev, 316 316 "%s - calling hangup\n", __func__); 317 317 tty_port_tty_hangup(&acm->port, false); ··· 322 322 acm->ctrlin = newctrl; 323 323 acm->oldcount = acm->iocount; 324 324 325 - if (difference & ACM_CTRL_DSR) 325 + if (difference & USB_CDC_SERIAL_STATE_DSR) 326 326 acm->iocount.dsr++; 327 - if (difference & ACM_CTRL_DCD) 327 + if (difference & USB_CDC_SERIAL_STATE_DCD) 328 328 acm->iocount.dcd++; 329 - if (newctrl & ACM_CTRL_BRK) { 329 + if (newctrl & USB_CDC_SERIAL_STATE_BREAK) { 330 330 acm->iocount.brk++; 331 331 tty_insert_flip_char(&acm->port, 0, TTY_BREAK); 332 332 } 333 - if (newctrl & ACM_CTRL_RI) 333 + if (newctrl & USB_CDC_SERIAL_STATE_RING_SIGNAL) 334 334 acm->iocount.rng++; 335 - if (newctrl & ACM_CTRL_FRAMING) 335 + if (newctrl & USB_CDC_SERIAL_STATE_FRAMING) 336 336 acm->iocount.frame++; 337 - if (newctrl & ACM_CTRL_PARITY) 337 + if (newctrl & USB_CDC_SERIAL_STATE_PARITY) 338 338 acm->iocount.parity++; 339 - if (newctrl & ACM_CTRL_OVERRUN) 339 + if (newctrl & USB_CDC_SERIAL_STATE_OVERRUN) 340 340 acm->iocount.overrun++; 341 341 spin_unlock_irqrestore(&acm->read_lock, flags); 342 342 343 - if (newctrl & ACM_CTRL_BRK) 343 + if (newctrl & USB_CDC_SERIAL_STATE_BREAK) 344 344 tty_flip_buffer_push(&acm->port); 345 345 346 346 if (difference) ··· 905 905 906 906 return (acm->ctrlout & USB_CDC_CTRL_DTR ? TIOCM_DTR : 0) | 907 907 (acm->ctrlout & USB_CDC_CTRL_RTS ? TIOCM_RTS : 0) | 908 - (acm->ctrlin & ACM_CTRL_DSR ? TIOCM_DSR : 0) | 909 - (acm->ctrlin & ACM_CTRL_RI ? TIOCM_RI : 0) | 910 - (acm->ctrlin & ACM_CTRL_DCD ? TIOCM_CD : 0) | 908 + (acm->ctrlin & USB_CDC_SERIAL_STATE_DSR ? TIOCM_DSR : 0) | 909 + (acm->ctrlin & USB_CDC_SERIAL_STATE_RING_SIGNAL ? TIOCM_RI : 0) | 910 + (acm->ctrlin & USB_CDC_SERIAL_STATE_DCD ? TIOCM_CD : 0) | 911 911 TIOCM_CTS; 912 912 } 913 913
-13
drivers/usb/class/cdc-acm.h
··· 23 23 #define USB_RT_ACM (USB_TYPE_CLASS | USB_RECIP_INTERFACE) 24 24 25 25 /* 26 - * Input control lines and line errors. 27 - */ 28 - 29 - #define ACM_CTRL_DCD 0x01 30 - #define ACM_CTRL_DSR 0x02 31 - #define ACM_CTRL_BRK 0x04 32 - #define ACM_CTRL_RI 0x08 33 - 34 - #define ACM_CTRL_FRAMING 0x10 35 - #define ACM_CTRL_PARITY 0x20 36 - #define ACM_CTRL_OVERRUN 0x40 37 - 38 - /* 39 26 * Internal driver structures. 40 27 */ 41 28