USB: serial: clean up throttle handling

Clean up the throttle implementation by dropping the redundant
throttle_req flag which was a remnant from back when there was only a
single read URB.

Also convert the throttled flag to an atomic bit flag.

Signed-off-by: Johan Hovold <johan@kernel.org>
This commit is contained in:
Johan Hovold
2019-04-25 18:05:37 +02:00
parent 3f5edd58d0
commit a8d78d9f38
2 changed files with 9 additions and 30 deletions

View File

@@ -28,6 +28,7 @@
/* USB serial flags */
#define USB_SERIAL_WRITE_BUSY 0
#define USB_SERIAL_THROTTLED 1
/**
* usb_serial_port: structure for the specific ports of a device.
@@ -67,8 +68,6 @@
* @flags: usb serial port flags
* @write_wait: a wait_queue_head_t used by the port.
* @work: work queue entry for the line discipline waking up.
* @throttled: nonzero if the read urb is inactive to throttle the device
* @throttle_req: nonzero if the tty wants to throttle us
* @dev: pointer to the serial device
*
* This structure is used by the usb-serial core and drivers for the specific
@@ -115,8 +114,6 @@ struct usb_serial_port {
unsigned long flags;
wait_queue_head_t write_wait;
struct work_struct work;
char throttled;
char throttle_req;
unsigned long sysrq; /* sysrq timeout */
struct device dev;
};