Commit d6f52500 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Greg Kroah-Hartman

staging: serqt_usb2: don't use sleep_on

sleep_on and related functions are going away and should not be used
in this driver any more.

This removes the call to interruptible_sleep_on for a wait queue that
is never woken up, and replaces an interruptible_sleep_on_timeout
call with the equivalent wait_event_interruptible_timeout() to
avoid a small race.

Both call sites still look fishy and need more work.

Signed-off-by: Arnd Bergmann <arndb.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: devel@driverdev.osuosl.org
Cc: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 310df69c
...@@ -969,17 +969,11 @@ static void qt_block_until_empty(struct tty_struct *tty, ...@@ -969,17 +969,11 @@ static void qt_block_until_empty(struct tty_struct *tty,
{ {
int timeout = HZ / 10; int timeout = HZ / 10;
int wait = 30; int wait = 30;
int count;
while (1) {
count = qt_chars_in_buffer(tty);
if (count <= 0)
return;
interruptible_sleep_on_timeout(&qt_port->wait, timeout);
/* returns if we get a signal, an error, or the buffer is empty */
while (wait_event_interruptible_timeout(qt_port->wait,
qt_chars_in_buffer(tty) <= 0,
timeout) == 0) {
wait--; wait--;
if (wait == 0) { if (wait == 0) {
dev_dbg(&qt_port->port->dev, "%s - TIMEOUT", __func__); dev_dbg(&qt_port->port->dev, "%s - TIMEOUT", __func__);
...@@ -1136,7 +1130,10 @@ static int qt_ioctl(struct tty_struct *tty, ...@@ -1136,7 +1130,10 @@ static int qt_ioctl(struct tty_struct *tty,
if (cmd == TIOCMIWAIT) { if (cmd == TIOCMIWAIT) {
while (qt_port != NULL) { while (qt_port != NULL) {
#if 0
/* this never wakes up */
interruptible_sleep_on(&qt_port->msr_wait); interruptible_sleep_on(&qt_port->msr_wait);
#endif
if (signal_pending(current)) if (signal_pending(current))
return -ERESTARTSYS; return -ERESTARTSYS;
else { else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment