mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiri Slaby <jslaby@suse.cz>
To: gregkh@linuxfoundation.org
Cc: peter@hurleysoftware.com, jirislaby@gmail.com,
	linux-kernel@vger.kernel.org
Subject: [PATCH 15/16] crisv10: use *_wait from tty_port
Date: Thu,  7 Mar 2013 13:12:39 +0100	[thread overview]
Message-ID: <1362658360-26629-15-git-send-email-jslaby@suse.cz> (raw)
In-Reply-To: <1362658360-26629-1-git-send-email-jslaby@suse.cz>

The same as flags, convert to using *_wait queues from tty_port.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/tty/serial/crisv10.c | 16 +++++++---------
 drivers/tty/serial/crisv10.h |  2 --
 2 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/drivers/tty/serial/crisv10.c b/drivers/tty/serial/crisv10.c
index 0e75ec33..ef5bca1 100644
--- a/drivers/tty/serial/crisv10.c
+++ b/drivers/tty/serial/crisv10.c
@@ -3827,10 +3827,10 @@ rs_close(struct tty_struct *tty, struct file * filp)
 	if (info->blocked_open) {
 		if (info->port.close_delay)
 			schedule_timeout_interruptible(info->port.close_delay);
-		wake_up_interruptible(&info->open_wait);
+		wake_up_interruptible(&info->port.open_wait);
 	}
 	info->port.flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING);
-	wake_up_interruptible(&info->close_wait);
+	wake_up_interruptible(&info->port.close_wait);
 	local_irq_restore(flags);
 
 	/* port closed */
@@ -3926,7 +3926,7 @@ rs_hangup(struct tty_struct *tty)
 	info->count = 0;
 	info->port.flags &= ~ASYNC_NORMAL_ACTIVE;
 	info->port.tty = NULL;
-	wake_up_interruptible(&info->open_wait);
+	wake_up_interruptible(&info->port.open_wait);
 }
 
 /*
@@ -3949,7 +3949,7 @@ block_til_ready(struct tty_struct *tty, struct file * filp,
 	 */
 	if (tty_hung_up_p(filp) ||
 	    (info->port.flags & ASYNC_CLOSING)) {
-		wait_event_interruptible_tty(tty, info->close_wait,
+		wait_event_interruptible_tty(tty, info->port.close_wait,
 			!(info->port.flags & ASYNC_CLOSING));
 #ifdef SERIAL_DO_RESTART
 		if (info->port.flags & ASYNC_HUP_NOTIFY)
@@ -3983,7 +3983,7 @@ block_til_ready(struct tty_struct *tty, struct file * filp,
 	 * exit, either normal or abnormal.
 	 */
 	retval = 0;
-	add_wait_queue(&info->open_wait, &wait);
+	add_wait_queue(&info->port.open_wait, &wait);
 #ifdef SERIAL_DEBUG_OPEN
 	printk("block_til_ready before block: ttyS%d, count = %d\n",
 	       info->line, info->count);
@@ -4030,7 +4030,7 @@ block_til_ready(struct tty_struct *tty, struct file * filp,
 		tty_lock(tty);
 	}
 	set_current_state(TASK_RUNNING);
-	remove_wait_queue(&info->open_wait, &wait);
+	remove_wait_queue(&info->port.open_wait, &wait);
 	if (extra_count)
 		info->count++;
 	info->blocked_open--;
@@ -4088,7 +4088,7 @@ rs_open(struct tty_struct *tty, struct file * filp)
 	 */
 	if (tty_hung_up_p(filp) ||
 	    (info->port.flags & ASYNC_CLOSING)) {
-		wait_event_interruptible_tty(tty, info->close_wait,
+		wait_event_interruptible_tty(tty, info->port.close_wait,
 			!(info->port.flags & ASYNC_CLOSING));
 #ifdef SERIAL_DO_RESTART
 		return ((info->port.flags & ASYNC_HUP_NOTIFY) ?
@@ -4445,8 +4445,6 @@ static int __init rs_init(void)
 		info->count = 0;
 		info->blocked_open = 0;
 		info->normal_termios = driver->init_termios;
-		init_waitqueue_head(&info->open_wait);
-		init_waitqueue_head(&info->close_wait);
 		info->xmit.buf = NULL;
 		info->xmit.tail = info->xmit.head = 0;
 		info->first_recv_buffer = info->last_recv_buffer = NULL;
diff --git a/drivers/tty/serial/crisv10.h b/drivers/tty/serial/crisv10.h
index a05c36b..1cd2299 100644
--- a/drivers/tty/serial/crisv10.h
+++ b/drivers/tty/serial/crisv10.h
@@ -101,8 +101,6 @@ struct e100_serial {
 	struct work_struct	work;
 	struct async_icount	icount;   /* error-statistics etc.*/
 	struct ktermios		normal_termios;
-	wait_queue_head_t	open_wait;
-	wait_queue_head_t	close_wait;
 
 	unsigned long char_time_usec;       /* The time for 1 char, in usecs */
 	unsigned long flush_time_usec;      /* How often we should flush */
-- 
1.8.1.4



  parent reply	other threads:[~2013-03-07 12:14 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-07 12:12 [PATCH 01/16] TTY: jsm, remove superfluous check Jiri Slaby
2013-03-07 12:12 ` [PATCH 02/16] TTY: synclink, " Jiri Slaby
2013-03-07 12:12 ` [PATCH 03/16] TTY: do not warn about setting speed via SPD_* Jiri Slaby
2013-03-07 12:12 ` [PATCH 04/16] TTY: msm_smd_tty, clean up activate/shutdown Jiri Slaby
2013-03-07 12:12 ` [PATCH 05/16] TTY: add tty_port_tty_wakeup helper Jiri Slaby
2013-03-08 15:02   ` Peter Hurley
2013-03-08 19:02     ` Jiri Slaby
2013-03-18 23:16       ` Greg KH
2013-03-07 12:12 ` [PATCH 06/16] TTY: add tty_port_tty_hangup helper Jiri Slaby
2013-03-07 12:12 ` [PATCH 07/16] TTY: quatech2, remove unneeded is_open Jiri Slaby
2013-03-13 13:46   ` Bill Pemberton
2013-03-13 14:17     ` Jiri Slaby
2013-03-13 14:27       ` Bill Pemberton
2013-03-07 12:12 ` [PATCH 08/16] TTY: serial/bfin_uart, unbreak build with KGDB enabled Jiri Slaby
2013-03-08  7:59   ` Sonic Zhang
2013-03-07 12:12 ` [PATCH 09/16] TTY: serial/msm_serial_hs, remove unused tty Jiri Slaby
2013-03-07 12:12 ` [PATCH 10/16] TTY: cleanup tty->hw_stopped uses Jiri Slaby
2013-03-08 14:39   ` Peter Hurley
2013-03-08 14:46     ` Jiri Slaby
2013-03-08 14:55       ` Peter Hurley
2013-03-07 12:12 ` [PATCH 11/16] crisv10: stop returning info from handle_ser_rx_interrupt Jiri Slaby
2013-03-08 15:06   ` Peter Hurley
2013-03-07 12:12 ` [PATCH 12/16] crisv10: use flags from tty_port Jiri Slaby
2013-03-07 12:12 ` [PATCH 13/16] crisv10: remove unused members Jiri Slaby
2013-03-07 12:12 ` [PATCH 14/16] crisv10: use close delays from tty_port Jiri Slaby
2013-03-07 12:12 ` Jiri Slaby [this message]
2013-03-07 12:12 ` [PATCH 16/16] crisv10: use counts " Jiri Slaby

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1362658360-26629-15-git-send-email-jslaby@suse.cz \
    --to=jslaby@suse.cz \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peter@hurleysoftware.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®