From 87758791c99715433841f1c054b49166506513e4 Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Mon, 5 Mar 2012 14:52:24 +0100 Subject: TTY: amiserial/simserial, use tty_port Add tty_port to serial_state and start using common tty port members from tty_port in amiserial and simserial. The rest will follow one by one. Signed-off-by: Jiri Slaby Cc: Geert Uytterhoeven Cc: Tony Luck Cc: Fenghua Yu Signed-off-by: Greg Kroah-Hartman --- arch/ia64/hp/sim/simserial.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'arch/ia64') diff --git a/arch/ia64/hp/sim/simserial.c b/arch/ia64/hp/sim/simserial.c index a76a27ed3de0..614c091b203f 100644 --- a/arch/ia64/hp/sim/simserial.c +++ b/arch/ia64/hp/sim/simserial.c @@ -165,7 +165,7 @@ static irqreturn_t rs_interrupt_single(int irq, void *dev_id) { struct serial_state *info = dev_id; - if (!info->tty) { + if (!info->tport.tty) { printk(KERN_INFO "simrs_interrupt_single: info|tty=0 info=%p problem\n", info); return IRQ_NONE; } @@ -173,7 +173,7 @@ static irqreturn_t rs_interrupt_single(int irq, void *dev_id) * pretty simple in our case, because we only get interrupts * on inbound traffic */ - receive_chars(info->tty); + receive_chars(info->tport.tty); return IRQ_HANDLED; } @@ -533,14 +533,14 @@ static void rs_close(struct tty_struct *tty, struct file * filp) shutdown(tty, info); rs_flush_buffer(tty); tty_ldisc_flush(tty); - info->tty = NULL; - if (info->blocked_open) { + info->tport.tty = NULL; + if (info->tport.blocked_open) { if (info->close_delay) schedule_timeout_interruptible(info->close_delay); - wake_up_interruptible(&info->open_wait); + wake_up_interruptible(&info->tport.open_wait); } info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING); - wake_up_interruptible(&info->close_wait); + wake_up_interruptible(&info->tport.close_wait); } /* @@ -569,8 +569,8 @@ static void rs_hangup(struct tty_struct *tty) info->count = 0; info->flags &= ~ASYNC_NORMAL_ACTIVE; - info->tty = NULL; - wake_up_interruptible(&info->open_wait); + info->tport.tty = NULL; + wake_up_interruptible(&info->tport.open_wait); } @@ -662,8 +662,9 @@ static int rs_open(struct tty_struct *tty, struct file * filp) unsigned long page; info->count++; - info->tty = tty; + info->tport.tty = tty; tty->driver_data = info; + tty->port = &info->tport; #ifdef SIMSERIAL_DEBUG printk("rs_open %s, count = %d\n", tty->name, info->count); @@ -685,7 +686,7 @@ static int rs_open(struct tty_struct *tty, struct file * filp) */ if (tty_hung_up_p(filp) || (info->flags & ASYNC_CLOSING)) { if (info->flags & ASYNC_CLOSING) - interruptible_sleep_on(&info->close_wait); + interruptible_sleep_on(&info->tport.close_wait); #ifdef SERIAL_DO_RESTART return ((info->flags & ASYNC_HUP_NOTIFY) ? -EAGAIN : -ERESTARTSYS); @@ -827,8 +828,7 @@ simrs_init (void) * Let's have a little bit of fun ! */ for (i = 0, state = rs_table; i < NR_PORTS; i++,state++) { - init_waitqueue_head(&state->open_wait); - init_waitqueue_head(&state->close_wait); + tty_port_init(&state->tport); if (state->type == PORT_UNKNOWN) continue; -- cgit v1.2.3