diff options
author | Peter Hurley <peter@hurleysoftware.com> | 2016-04-09 20:53:25 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-04-30 12:26:55 -0400 |
commit | d41861ca19c9e96f12a4f1ebbc8255d00909a232 (patch) | |
tree | 4b09c15500d404b0b375469dd673f0bc8fd05f5f /drivers/usb/class/cdc-acm.c | |
parent | 80f02d5424301bf4df195d09b1a664f394435851 (diff) |
tty: Replace ASYNC_INITIALIZED bit and update atomically
Replace ASYNC_INITIALIZED bit in the tty_port::flags field with
TTY_PORT_INITIALIZED bit in the tty_port::iflags field. Introduce helpers
tty_port_set_initialized() and tty_port_initialized() to abstract
atomic bit ops.
Note: the transforms for test_and_set_bit() and test_and_clear_bit()
are unnecessary as the state transitions are already mutually exclusive;
the tty lock prevents concurrent open/close/hangup.
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/class/cdc-acm.c')
-rw-r--r-- | drivers/usb/class/cdc-acm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index a6c4a1b895bd..94a14f5dc4d4 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c | |||
@@ -1680,7 +1680,7 @@ static int acm_resume(struct usb_interface *intf) | |||
1680 | if (--acm->susp_count) | 1680 | if (--acm->susp_count) |
1681 | goto out; | 1681 | goto out; |
1682 | 1682 | ||
1683 | if (test_bit(ASYNCB_INITIALIZED, &acm->port.flags)) { | 1683 | if (tty_port_initialized(&acm->port)) { |
1684 | rv = usb_submit_urb(acm->ctrlurb, GFP_ATOMIC); | 1684 | rv = usb_submit_urb(acm->ctrlurb, GFP_ATOMIC); |
1685 | 1685 | ||
1686 | for (;;) { | 1686 | for (;;) { |
@@ -1710,7 +1710,7 @@ static int acm_reset_resume(struct usb_interface *intf) | |||
1710 | { | 1710 | { |
1711 | struct acm *acm = usb_get_intfdata(intf); | 1711 | struct acm *acm = usb_get_intfdata(intf); |
1712 | 1712 | ||
1713 | if (test_bit(ASYNCB_INITIALIZED, &acm->port.flags)) | 1713 | if (tty_port_initialized(&acm->port)) |
1714 | tty_port_tty_hangup(&acm->port, false); | 1714 | tty_port_tty_hangup(&acm->port, false); |
1715 | 1715 | ||
1716 | return acm_resume(intf); | 1716 | return acm_resume(intf); |