diff options
author | Jiri Slaby <jslaby@suse.cz> | 2012-03-05 08:52:27 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-03-08 15:30:51 -0500 |
commit | 01bd730d92bd002adc3f3317d8e3328c629b436c (patch) | |
tree | ff7d9a72c32437616834ff6bb6f092e0bd91dbf6 /arch/ia64/hp | |
parent | 12c8035435fa16e3f6b18049bb1d7815c00a7a58 (diff) |
TTY: amiserial/simserial, use flags from tty_port
This changes flags' type to ulong which is appropriate for all the
set/clear_bits performed in the drivers..
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/hp')
-rw-r--r-- | arch/ia64/hp/sim/simserial.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/arch/ia64/hp/sim/simserial.c b/arch/ia64/hp/sim/simserial.c index baa2b1ec00a0..c65c49d31e7f 100644 --- a/arch/ia64/hp/sim/simserial.c +++ b/arch/ia64/hp/sim/simserial.c | |||
@@ -448,7 +448,7 @@ static void shutdown(struct tty_struct *tty, struct serial_state *info) | |||
448 | { | 448 | { |
449 | unsigned long flags; | 449 | unsigned long flags; |
450 | 450 | ||
451 | if (!(info->flags & ASYNC_INITIALIZED)) | 451 | if (!(info->tport.flags & ASYNC_INITIALIZED)) |
452 | return; | 452 | return; |
453 | 453 | ||
454 | #ifdef SIMSERIAL_DEBUG | 454 | #ifdef SIMSERIAL_DEBUG |
@@ -468,7 +468,7 @@ static void shutdown(struct tty_struct *tty, struct serial_state *info) | |||
468 | 468 | ||
469 | set_bit(TTY_IO_ERROR, &tty->flags); | 469 | set_bit(TTY_IO_ERROR, &tty->flags); |
470 | 470 | ||
471 | info->flags &= ~ASYNC_INITIALIZED; | 471 | info->tport.flags &= ~ASYNC_INITIALIZED; |
472 | } | 472 | } |
473 | local_irq_restore(flags); | 473 | local_irq_restore(flags); |
474 | } | 474 | } |
@@ -523,7 +523,7 @@ static void rs_close(struct tty_struct *tty, struct file * filp) | |||
523 | local_irq_restore(flags); | 523 | local_irq_restore(flags); |
524 | return; | 524 | return; |
525 | } | 525 | } |
526 | info->flags |= ASYNC_CLOSING; | 526 | info->tport.flags |= ASYNC_CLOSING; |
527 | local_irq_restore(flags); | 527 | local_irq_restore(flags); |
528 | 528 | ||
529 | /* | 529 | /* |
@@ -539,7 +539,7 @@ static void rs_close(struct tty_struct *tty, struct file * filp) | |||
539 | schedule_timeout_interruptible(info->tport.close_delay); | 539 | schedule_timeout_interruptible(info->tport.close_delay); |
540 | wake_up_interruptible(&info->tport.open_wait); | 540 | wake_up_interruptible(&info->tport.open_wait); |
541 | } | 541 | } |
542 | info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING); | 542 | info->tport.flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING); |
543 | wake_up_interruptible(&info->tport.close_wait); | 543 | wake_up_interruptible(&info->tport.close_wait); |
544 | } | 544 | } |
545 | 545 | ||
@@ -563,12 +563,12 @@ static void rs_hangup(struct tty_struct *tty) | |||
563 | #endif | 563 | #endif |
564 | 564 | ||
565 | rs_flush_buffer(tty); | 565 | rs_flush_buffer(tty); |
566 | if (info->flags & ASYNC_CLOSING) | 566 | if (info->tport.flags & ASYNC_CLOSING) |
567 | return; | 567 | return; |
568 | shutdown(tty, info); | 568 | shutdown(tty, info); |
569 | 569 | ||
570 | info->tport.count = 0; | 570 | info->tport.count = 0; |
571 | info->flags &= ~ASYNC_NORMAL_ACTIVE; | 571 | info->tport.flags &= ~ASYNC_NORMAL_ACTIVE; |
572 | info->tport.tty = NULL; | 572 | info->tport.tty = NULL; |
573 | wake_up_interruptible(&info->tport.open_wait); | 573 | wake_up_interruptible(&info->tport.open_wait); |
574 | } | 574 | } |
@@ -576,6 +576,7 @@ static void rs_hangup(struct tty_struct *tty) | |||
576 | 576 | ||
577 | static int startup(struct tty_struct *tty, struct serial_state *state) | 577 | static int startup(struct tty_struct *tty, struct serial_state *state) |
578 | { | 578 | { |
579 | struct tty_port *port = &state->tport; | ||
579 | unsigned long flags; | 580 | unsigned long flags; |
580 | int retval=0; | 581 | int retval=0; |
581 | unsigned long page; | 582 | unsigned long page; |
@@ -586,7 +587,7 @@ static int startup(struct tty_struct *tty, struct serial_state *state) | |||
586 | 587 | ||
587 | local_irq_save(flags); | 588 | local_irq_save(flags); |
588 | 589 | ||
589 | if (state->flags & ASYNC_INITIALIZED) { | 590 | if (port->flags & ASYNC_INITIALIZED) { |
590 | free_page(page); | 591 | free_page(page); |
591 | goto errout; | 592 | goto errout; |
592 | } | 593 | } |
@@ -630,16 +631,16 @@ static int startup(struct tty_struct *tty, struct serial_state *state) | |||
630 | /* | 631 | /* |
631 | * Set up the tty->alt_speed kludge | 632 | * Set up the tty->alt_speed kludge |
632 | */ | 633 | */ |
633 | if ((state->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI) | 634 | if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI) |
634 | tty->alt_speed = 57600; | 635 | tty->alt_speed = 57600; |
635 | if ((state->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI) | 636 | if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI) |
636 | tty->alt_speed = 115200; | 637 | tty->alt_speed = 115200; |
637 | if ((state->flags & ASYNC_SPD_MASK) == ASYNC_SPD_SHI) | 638 | if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_SHI) |
638 | tty->alt_speed = 230400; | 639 | tty->alt_speed = 230400; |
639 | if ((state->flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP) | 640 | if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP) |
640 | tty->alt_speed = 460800; | 641 | tty->alt_speed = 460800; |
641 | 642 | ||
642 | state->flags |= ASYNC_INITIALIZED; | 643 | port->flags |= ASYNC_INITIALIZED; |
643 | local_irq_restore(flags); | 644 | local_irq_restore(flags); |
644 | return 0; | 645 | return 0; |
645 | 646 | ||
@@ -669,7 +670,7 @@ static int rs_open(struct tty_struct *tty, struct file * filp) | |||
669 | #ifdef SIMSERIAL_DEBUG | 670 | #ifdef SIMSERIAL_DEBUG |
670 | printk("rs_open %s, count = %d\n", tty->name, info->tport.count); | 671 | printk("rs_open %s, count = %d\n", tty->name, info->tport.count); |
671 | #endif | 672 | #endif |
672 | tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0; | 673 | tty->low_latency = (info->tport.flags & ASYNC_LOW_LATENCY) ? 1 : 0; |
673 | 674 | ||
674 | if (!tmp_buf) { | 675 | if (!tmp_buf) { |
675 | page = get_zeroed_page(GFP_KERNEL); | 676 | page = get_zeroed_page(GFP_KERNEL); |
@@ -684,11 +685,11 @@ static int rs_open(struct tty_struct *tty, struct file * filp) | |||
684 | /* | 685 | /* |
685 | * If the port is the middle of closing, bail out now | 686 | * If the port is the middle of closing, bail out now |
686 | */ | 687 | */ |
687 | if (tty_hung_up_p(filp) || (info->flags & ASYNC_CLOSING)) { | 688 | if (tty_hung_up_p(filp) || (info->tport.flags & ASYNC_CLOSING)) { |
688 | if (info->flags & ASYNC_CLOSING) | 689 | if (info->tport.flags & ASYNC_CLOSING) |
689 | interruptible_sleep_on(&info->tport.close_wait); | 690 | interruptible_sleep_on(&info->tport.close_wait); |
690 | #ifdef SERIAL_DO_RESTART | 691 | #ifdef SERIAL_DO_RESTART |
691 | return ((info->flags & ASYNC_HUP_NOTIFY) ? | 692 | return ((info->tport.flags & ASYNC_HUP_NOTIFY) ? |
692 | -EAGAIN : -ERESTARTSYS); | 693 | -EAGAIN : -ERESTARTSYS); |
693 | #else | 694 | #else |
694 | return -EAGAIN; | 695 | return -EAGAIN; |