aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2012-03-05 08:52:24 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-03-08 15:30:50 -0500
commit87758791c99715433841f1c054b49166506513e4 (patch)
treea0ba9a0e5dea44992557fcd681077ee8ededb085 /arch/ia64
parent5e99d5458729b0eb763ca83a2fbb95f6276c4243 (diff)
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 <jslaby@suse.cz> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/ia64')
-rw-r--r--arch/ia64/hp/sim/simserial.c24
1 files changed, 12 insertions, 12 deletions
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)
165{ 165{
166 struct serial_state *info = dev_id; 166 struct serial_state *info = dev_id;
167 167
168 if (!info->tty) { 168 if (!info->tport.tty) {
169 printk(KERN_INFO "simrs_interrupt_single: info|tty=0 info=%p problem\n", info); 169 printk(KERN_INFO "simrs_interrupt_single: info|tty=0 info=%p problem\n", info);
170 return IRQ_NONE; 170 return IRQ_NONE;
171 } 171 }
@@ -173,7 +173,7 @@ static irqreturn_t rs_interrupt_single(int irq, void *dev_id)
173 * pretty simple in our case, because we only get interrupts 173 * pretty simple in our case, because we only get interrupts
174 * on inbound traffic 174 * on inbound traffic
175 */ 175 */
176 receive_chars(info->tty); 176 receive_chars(info->tport.tty);
177 return IRQ_HANDLED; 177 return IRQ_HANDLED;
178} 178}
179 179
@@ -533,14 +533,14 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
533 shutdown(tty, info); 533 shutdown(tty, info);
534 rs_flush_buffer(tty); 534 rs_flush_buffer(tty);
535 tty_ldisc_flush(tty); 535 tty_ldisc_flush(tty);
536 info->tty = NULL; 536 info->tport.tty = NULL;
537 if (info->blocked_open) { 537 if (info->tport.blocked_open) {
538 if (info->close_delay) 538 if (info->close_delay)
539 schedule_timeout_interruptible(info->close_delay); 539 schedule_timeout_interruptible(info->close_delay);
540 wake_up_interruptible(&info->open_wait); 540 wake_up_interruptible(&info->tport.open_wait);
541 } 541 }
542 info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING); 542 info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING);
543 wake_up_interruptible(&info->close_wait); 543 wake_up_interruptible(&info->tport.close_wait);
544} 544}
545 545
546/* 546/*
@@ -569,8 +569,8 @@ static void rs_hangup(struct tty_struct *tty)
569 569
570 info->count = 0; 570 info->count = 0;
571 info->flags &= ~ASYNC_NORMAL_ACTIVE; 571 info->flags &= ~ASYNC_NORMAL_ACTIVE;
572 info->tty = NULL; 572 info->tport.tty = NULL;
573 wake_up_interruptible(&info->open_wait); 573 wake_up_interruptible(&info->tport.open_wait);
574} 574}
575 575
576 576
@@ -662,8 +662,9 @@ static int rs_open(struct tty_struct *tty, struct file * filp)
662 unsigned long page; 662 unsigned long page;
663 663
664 info->count++; 664 info->count++;
665 info->tty = tty; 665 info->tport.tty = tty;
666 tty->driver_data = info; 666 tty->driver_data = info;
667 tty->port = &info->tport;
667 668
668#ifdef SIMSERIAL_DEBUG 669#ifdef SIMSERIAL_DEBUG
669 printk("rs_open %s, count = %d\n", tty->name, info->count); 670 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)
685 */ 686 */
686 if (tty_hung_up_p(filp) || (info->flags & ASYNC_CLOSING)) { 687 if (tty_hung_up_p(filp) || (info->flags & ASYNC_CLOSING)) {
687 if (info->flags & ASYNC_CLOSING) 688 if (info->flags & ASYNC_CLOSING)
688 interruptible_sleep_on(&info->close_wait); 689 interruptible_sleep_on(&info->tport.close_wait);
689#ifdef SERIAL_DO_RESTART 690#ifdef SERIAL_DO_RESTART
690 return ((info->flags & ASYNC_HUP_NOTIFY) ? 691 return ((info->flags & ASYNC_HUP_NOTIFY) ?
691 -EAGAIN : -ERESTARTSYS); 692 -EAGAIN : -ERESTARTSYS);
@@ -827,8 +828,7 @@ simrs_init (void)
827 * Let's have a little bit of fun ! 828 * Let's have a little bit of fun !
828 */ 829 */
829 for (i = 0, state = rs_table; i < NR_PORTS; i++,state++) { 830 for (i = 0, state = rs_table; i < NR_PORTS; i++,state++) {
830 init_waitqueue_head(&state->open_wait); 831 tty_port_init(&state->tport);
831 init_waitqueue_head(&state->close_wait);
832 832
833 if (state->type == PORT_UNKNOWN) continue; 833 if (state->type == PORT_UNKNOWN) continue;
834 834