Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 127bf166 authored by Hari Prasath Gujulan Elango's avatar Hari Prasath Gujulan Elango Committed by Greg Kroah-Hartman
Browse files

staging: dgnc: convert to wait_event_interruptible_timeout



This patch makes use of wait_event_interruptible_timeout to achieve
timeout functionality.This is a TODO mentiond in the comment which is also
removed.It also aligns with what the function is supposed to do as in the
comments.

Signed-off-by: default avatarHari Prasath Gujulan Elango <hgujulan@visteon.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 210ba93a
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1306,10 +1306,10 @@ static int neo_drain(struct tty_struct *tty, uint seconds)
	/*
	 * Go to sleep waiting for the tty layer to wake me back up when
	 * the empty flag goes away.
	 *
	 * NOTE: TODO: Do something with time passed in.
	 */
	rc = wait_event_interruptible(un->un_flags_wait, ((un->un_flags & UN_EMPTY) == 0));
	rc = wait_event_interruptible_timeout(un->un_flags_wait,
					      ((un->un_flags & UN_EMPTY) == 0),
					      msecs_to_jiffies(seconds * 1000));

	/* If ret is non-zero, user ctrl-c'ed us */
	return rc;