Skip to content

Commit 71b9020

Browse files
authored
Merge pull request #3 from saurontech/kernel_5_15
replace outdated test_bit(ASYNCB_INITIALIZED)
2 parents 7e28f08 + 3436274 commit 71b9020

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

driver/xr_usb_serial_common.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1838,8 +1838,7 @@ static int xr_usb_serial_suspend(struct usb_interface *intf, pm_message_t messag
18381838

18391839
if (cnt)
18401840
return 0;
1841-
1842-
if (test_bit(ASYNCB_INITIALIZED, &xr_usb_serial->port.flags))
1841+
if(tty_port_initialized(&xr_usb_serial->port))
18431842
stop_data_traffic(xr_usb_serial);
18441843

18451844
return 0;
@@ -1860,7 +1859,7 @@ static int xr_usb_serial_resume(struct usb_interface *intf)
18601859
if (cnt)
18611860
return 0;
18621861

1863-
if (test_bit(ASYNCB_INITIALIZED, &xr_usb_serial->port.flags)) {
1862+
if (tty_port_initialized(&xr_usb_serial->port)) {
18641863
rv = usb_submit_urb(xr_usb_serial->ctrlurb, GFP_NOIO);
18651864

18661865
spin_lock_irq(&xr_usb_serial->write_lock);
@@ -1894,7 +1893,7 @@ static int xr_usb_serial_reset_resume(struct usb_interface *intf)
18941893
#else
18951894
struct tty_struct *tty;
18961895
#endif
1897-
if (test_bit(ASYNCB_INITIALIZED, &xr_usb_serial->port.flags)){
1896+
if (tty_port_initialized(&xr_usb_serial->port)){
18981897
#if LINUX_VERSION_CODE > KERNEL_VERSION(3, 9, 0)
18991898
tty_port_tty_hangup(&xr_usb_serial->port, false);
19001899
#else

0 commit comments

Comments
 (0)