aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/synclink_gt.c
diff options
context:
space:
mode:
authorAlan Cox <alan@redhat.com>2009-01-02 08:45:19 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-02 13:19:38 -0500
commit5d951fb458f847e5485b5251597fbf326000bb3b (patch)
treef668a015282f657f258995a1e5a85e145ca8251a /drivers/char/synclink_gt.c
parentd0c9873addc1f18e7becb50094dad07df8cc4694 (diff)
tty: Pull the dtr raise into tty port
This moves another per device special out of what should be shared open wait paths into private methods Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/synclink_gt.c')
-rw-r--r--drivers/char/synclink_gt.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/char/synclink_gt.c b/drivers/char/synclink_gt.c
index 39ccaba8ca37..625c9bde3be8 100644
--- a/drivers/char/synclink_gt.c
+++ b/drivers/char/synclink_gt.c
@@ -3143,6 +3143,18 @@ static int carrier_raised(struct tty_port *port)
3143 return (info->signals & SerialSignal_DCD) ? 1 : 0; 3143 return (info->signals & SerialSignal_DCD) ? 1 : 0;
3144} 3144}
3145 3145
3146static void raise_dtr_rts(struct tty_port *port)
3147{
3148 unsigned long flags;
3149 struct slgt_info *info = container_of(port, struct slgt_info, port);
3150
3151 spin_lock_irqsave(&info->lock,flags);
3152 info->signals |= SerialSignal_RTS + SerialSignal_DTR;
3153 set_signals(info);
3154 spin_unlock_irqrestore(&info->lock,flags);
3155}
3156
3157
3146/* 3158/*
3147 * block current process until the device is ready to open 3159 * block current process until the device is ready to open
3148 */ 3160 */
@@ -3187,12 +3199,8 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,
3187 port->blocked_open++; 3199 port->blocked_open++;
3188 3200
3189 while (1) { 3201 while (1) {
3190 if ((tty->termios->c_cflag & CBAUD)) { 3202 if ((tty->termios->c_cflag & CBAUD))
3191 spin_lock_irqsave(&info->lock,flags); 3203 tty_port_raise_dtr_rts(port);
3192 info->signals |= SerialSignal_RTS + SerialSignal_DTR;
3193 set_signals(info);
3194 spin_unlock_irqrestore(&info->lock,flags);
3195 }
3196 3204
3197 set_current_state(TASK_INTERRUPTIBLE); 3205 set_current_state(TASK_INTERRUPTIBLE);
3198 3206
@@ -3455,6 +3463,7 @@ static void add_device(struct slgt_info *info)
3455 3463
3456static const struct tty_port_operations slgt_port_ops = { 3464static const struct tty_port_operations slgt_port_ops = {
3457 .carrier_raised = carrier_raised, 3465 .carrier_raised = carrier_raised,
3466 .raise_dtr_rts = raise_dtr_rts,
3458}; 3467};
3459 3468
3460/* 3469/*