diff options
author | Alan Cox <alan@redhat.com> | 2009-01-02 08:48:23 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-02 13:19:41 -0500 |
commit | 21bed701da009b4192d9e86b3596cf210ac7369c (patch) | |
tree | 6a22a10f378e4e95539cf9243850639f39cd4a9b /drivers/char/rocket.c | |
parent | c1314a49d7907b96d72f2c41f8927fc3c738e956 (diff) |
tty: make rocketport use standard port->flags
We need to this ready for using the standard helpers
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/rocket.c')
-rw-r--r-- | drivers/char/rocket.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c index efc3e5c51f6f..ca6fcdcca56e 100644 --- a/drivers/char/rocket.c +++ b/drivers/char/rocket.c | |||
@@ -499,7 +499,7 @@ static void rp_handle_port(struct r_port *info) | |||
499 | if (!info) | 499 | if (!info) |
500 | return; | 500 | return; |
501 | 501 | ||
502 | if ((info->flags & ASYNC_INITIALIZED) == 0) { | 502 | if ((info->port.flags & ASYNC_INITIALIZED) == 0) { |
503 | printk(KERN_WARNING "rp: WARNING: rp_handle_port called with " | 503 | printk(KERN_WARNING "rp: WARNING: rp_handle_port called with " |
504 | "info->flags & NOT_INIT\n"); | 504 | "info->flags & NOT_INIT\n"); |
505 | return; | 505 | return; |
@@ -892,11 +892,11 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, | |||
892 | * until it's done, and then try again. | 892 | * until it's done, and then try again. |
893 | */ | 893 | */ |
894 | if (tty_hung_up_p(filp)) | 894 | if (tty_hung_up_p(filp)) |
895 | return ((info->flags & ASYNC_HUP_NOTIFY) ? -EAGAIN : -ERESTARTSYS); | 895 | return ((info->port.flags & ASYNC_HUP_NOTIFY) ? -EAGAIN : -ERESTARTSYS); |
896 | if (info->flags & ASYNC_CLOSING) { | 896 | if (info->flags & ASYNC_CLOSING) { |
897 | if (wait_for_completion_interruptible(&info->close_wait)) | 897 | if (wait_for_completion_interruptible(&info->close_wait)) |
898 | return -ERESTARTSYS; | 898 | return -ERESTARTSYS; |
899 | return ((info->flags & ASYNC_HUP_NOTIFY) ? -EAGAIN : -ERESTARTSYS); | 899 | return ((info->port.flags & ASYNC_HUP_NOTIFY) ? -EAGAIN : -ERESTARTSYS); |
900 | } | 900 | } |
901 | 901 | ||
902 | /* | 902 | /* |
@@ -904,7 +904,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, | |||
904 | * then make the check up front and then exit. | 904 | * then make the check up front and then exit. |
905 | */ | 905 | */ |
906 | if ((filp->f_flags & O_NONBLOCK) || (tty->flags & (1 << TTY_IO_ERROR))) { | 906 | if ((filp->f_flags & O_NONBLOCK) || (tty->flags & (1 << TTY_IO_ERROR))) { |
907 | info->flags |= ASYNC_NORMAL_ACTIVE; | 907 | info->port.flags |= ASYNC_NORMAL_ACTIVE; |
908 | return 0; | 908 | return 0; |
909 | } | 909 | } |
910 | if (tty->termios->c_cflag & CLOCAL) | 910 | if (tty->termios->c_cflag & CLOCAL) |
@@ -923,7 +923,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, | |||
923 | spin_lock_irqsave(&port->lock, flags); | 923 | spin_lock_irqsave(&port->lock, flags); |
924 | 924 | ||
925 | #ifdef ROCKET_DISABLE_SIMUSAGE | 925 | #ifdef ROCKET_DISABLE_SIMUSAGE |
926 | info->flags |= ASYNC_NORMAL_ACTIVE; | 926 | info->port.flags |= ASYNC_NORMAL_ACTIVE; |
927 | #else | 927 | #else |
928 | if (!tty_hung_up_p(filp)) { | 928 | if (!tty_hung_up_p(filp)) { |
929 | extra_count = 1; | 929 | extra_count = 1; |
@@ -938,14 +938,14 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, | |||
938 | if (tty->termios->c_cflag & CBAUD) | 938 | if (tty->termios->c_cflag & CBAUD) |
939 | tty_port_raise_dtr_rts(port); | 939 | tty_port_raise_dtr_rts(port); |
940 | set_current_state(TASK_INTERRUPTIBLE); | 940 | set_current_state(TASK_INTERRUPTIBLE); |
941 | if (tty_hung_up_p(filp) || !(info->flags & ASYNC_INITIALIZED)) { | 941 | if (tty_hung_up_p(filp) || !(info->port.flags & ASYNC_INITIALIZED)) { |
942 | if (info->flags & ASYNC_HUP_NOTIFY) | 942 | if (info->port.flags & ASYNC_HUP_NOTIFY) |
943 | retval = -EAGAIN; | 943 | retval = -EAGAIN; |
944 | else | 944 | else |
945 | retval = -ERESTARTSYS; | 945 | retval = -ERESTARTSYS; |
946 | break; | 946 | break; |
947 | } | 947 | } |
948 | if (!(info->flags & ASYNC_CLOSING) && | 948 | if (!(info->port.flags & ASYNC_CLOSING) && |
949 | (do_clocal || tty_port_carrier_raised(port))) | 949 | (do_clocal || tty_port_carrier_raised(port))) |
950 | break; | 950 | break; |
951 | if (signal_pending(current)) { | 951 | if (signal_pending(current)) { |
@@ -954,7 +954,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, | |||
954 | } | 954 | } |
955 | #ifdef ROCKET_DEBUG_OPEN | 955 | #ifdef ROCKET_DEBUG_OPEN |
956 | printk(KERN_INFO "block_til_ready blocking: ttyR%d, count = %d, flags=0x%0x\n", | 956 | printk(KERN_INFO "block_til_ready blocking: ttyR%d, count = %d, flags=0x%0x\n", |
957 | info->line, port->count, info->flags); | 957 | info->line, port->count, info->port.flags); |
958 | #endif | 958 | #endif |
959 | schedule(); /* Don't hold spinlock here, will hang PC */ | 959 | schedule(); /* Don't hold spinlock here, will hang PC */ |
960 | } | 960 | } |
@@ -975,7 +975,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, | |||
975 | #endif | 975 | #endif |
976 | if (retval) | 976 | if (retval) |
977 | return retval; | 977 | return retval; |
978 | info->flags |= ASYNC_NORMAL_ACTIVE; | 978 | info->port.flags |= ASYNC_NORMAL_ACTIVE; |
979 | return 0; | 979 | return 0; |
980 | } | 980 | } |
981 | 981 | ||
@@ -998,12 +998,12 @@ static int rp_open(struct tty_struct *tty, struct file *filp) | |||
998 | if (!page) | 998 | if (!page) |
999 | return -ENOMEM; | 999 | return -ENOMEM; |
1000 | 1000 | ||
1001 | if (info->flags & ASYNC_CLOSING) { | 1001 | if (info->port.flags & ASYNC_CLOSING) { |
1002 | retval = wait_for_completion_interruptible(&info->close_wait); | 1002 | retval = wait_for_completion_interruptible(&info->close_wait); |
1003 | free_page(page); | 1003 | free_page(page); |
1004 | if (retval) | 1004 | if (retval) |
1005 | return retval; | 1005 | return retval; |
1006 | return ((info->flags & ASYNC_HUP_NOTIFY) ? -EAGAIN : -ERESTARTSYS); | 1006 | return ((info->port.flags & ASYNC_HUP_NOTIFY) ? -EAGAIN : -ERESTARTSYS); |
1007 | } | 1007 | } |
1008 | 1008 | ||
1009 | /* | 1009 | /* |
@@ -1032,7 +1032,7 @@ static int rp_open(struct tty_struct *tty, struct file *filp) | |||
1032 | /* | 1032 | /* |
1033 | * Info->count is now 1; so it's safe to sleep now. | 1033 | * Info->count is now 1; so it's safe to sleep now. |
1034 | */ | 1034 | */ |
1035 | if ((info->flags & ASYNC_INITIALIZED) == 0) { | 1035 | if ((info->port.flags & ASYNC_INITIALIZED) == 0) { |
1036 | cp = &info->channel; | 1036 | cp = &info->channel; |
1037 | sSetRxTrigger(cp, TRIG_1); | 1037 | sSetRxTrigger(cp, TRIG_1); |
1038 | if (sGetChanStatus(cp) & CD_ACT) | 1038 | if (sGetChanStatus(cp) & CD_ACT) |
@@ -1056,7 +1056,7 @@ static int rp_open(struct tty_struct *tty, struct file *filp) | |||
1056 | sEnRxFIFO(cp); | 1056 | sEnRxFIFO(cp); |
1057 | sEnTransmit(cp); | 1057 | sEnTransmit(cp); |
1058 | 1058 | ||
1059 | info->flags |= ASYNC_INITIALIZED; | 1059 | info->port.flags |= ASYNC_INITIALIZED; |
1060 | 1060 | ||
1061 | /* | 1061 | /* |
1062 | * Set up the tty->alt_speed kludge | 1062 | * Set up the tty->alt_speed kludge |
@@ -1132,7 +1132,7 @@ static void rp_close(struct tty_struct *tty, struct file *filp) | |||
1132 | spin_unlock_irqrestore(&port->lock, flags); | 1132 | spin_unlock_irqrestore(&port->lock, flags); |
1133 | return; | 1133 | return; |
1134 | } | 1134 | } |
1135 | info->flags |= ASYNC_CLOSING; | 1135 | info->port.flags |= ASYNC_CLOSING; |
1136 | spin_unlock_irqrestore(&port->lock, flags); | 1136 | spin_unlock_irqrestore(&port->lock, flags); |
1137 | 1137 | ||
1138 | cp = &info->channel; | 1138 | cp = &info->channel; |
@@ -1193,7 +1193,7 @@ static void rp_close(struct tty_struct *tty, struct file *filp) | |||
1193 | info->xmit_buf = NULL; | 1193 | info->xmit_buf = NULL; |
1194 | } | 1194 | } |
1195 | } | 1195 | } |
1196 | info->flags &= ~(ASYNC_INITIALIZED | ASYNC_CLOSING | ASYNC_NORMAL_ACTIVE); | 1196 | info->port.flags &= ~(ASYNC_INITIALIZED | ASYNC_CLOSING | ASYNC_NORMAL_ACTIVE); |
1197 | tty->closing = 0; | 1197 | tty->closing = 0; |
1198 | complete_all(&info->close_wait); | 1198 | complete_all(&info->close_wait); |
1199 | atomic_dec(&rp_num_ports_open); | 1199 | atomic_dec(&rp_num_ports_open); |
@@ -1650,14 +1650,14 @@ static void rp_hangup(struct tty_struct *tty) | |||
1650 | printk(KERN_INFO "rp_hangup of ttyR%d...\n", info->line); | 1650 | printk(KERN_INFO "rp_hangup of ttyR%d...\n", info->line); |
1651 | #endif | 1651 | #endif |
1652 | rp_flush_buffer(tty); | 1652 | rp_flush_buffer(tty); |
1653 | if (info->flags & ASYNC_CLOSING) | 1653 | if (info->port.flags & ASYNC_CLOSING) |
1654 | return; | 1654 | return; |
1655 | if (info->port.count) | 1655 | if (info->port.count) |
1656 | atomic_dec(&rp_num_ports_open); | 1656 | atomic_dec(&rp_num_ports_open); |
1657 | clear_bit((info->aiop * 8) + info->chan, (void *) &xmit_flags[info->board]); | 1657 | clear_bit((info->aiop * 8) + info->chan, (void *) &xmit_flags[info->board]); |
1658 | 1658 | ||
1659 | info->port.count = 0; | 1659 | info->port.count = 0; |
1660 | info->flags &= ~ASYNC_NORMAL_ACTIVE; | 1660 | info->port.flags &= ~ASYNC_NORMAL_ACTIVE; |
1661 | info->port.tty = NULL; | 1661 | info->port.tty = NULL; |
1662 | 1662 | ||
1663 | cp = &info->channel; | 1663 | cp = &info->channel; |
@@ -1667,7 +1667,7 @@ static void rp_hangup(struct tty_struct *tty) | |||
1667 | sDisCTSFlowCtl(cp); | 1667 | sDisCTSFlowCtl(cp); |
1668 | sDisTxSoftFlowCtl(cp); | 1668 | sDisTxSoftFlowCtl(cp); |
1669 | sClrTxXOFF(cp); | 1669 | sClrTxXOFF(cp); |
1670 | info->flags &= ~ASYNC_INITIALIZED; | 1670 | info->port.flags &= ~ASYNC_INITIALIZED; |
1671 | 1671 | ||
1672 | wake_up_interruptible(&info->port.open_wait); | 1672 | wake_up_interruptible(&info->port.open_wait); |
1673 | } | 1673 | } |