diff options
author | Alan Cox <alan@redhat.com> | 2009-01-02 08:45:19 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-02 13:19:38 -0500 |
commit | 5d951fb458f847e5485b5251597fbf326000bb3b (patch) | |
tree | f668a015282f657f258995a1e5a85e145ca8251a /drivers/char/rocket.c | |
parent | d0c9873addc1f18e7becb50094dad07df8cc4694 (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/rocket.c')
-rw-r--r-- | drivers/char/rocket.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c index 4a4110e703a5..f4d9c3993488 100644 --- a/drivers/char/rocket.c +++ b/drivers/char/rocket.c | |||
@@ -870,6 +870,13 @@ static int carrier_raised(struct tty_port *port) | |||
870 | return (sGetChanStatusLo(&info->channel) & CD_ACT) ? 1 : 0; | 870 | return (sGetChanStatusLo(&info->channel) & CD_ACT) ? 1 : 0; |
871 | } | 871 | } |
872 | 872 | ||
873 | static void raise_dtr_rts(struct tty_port *port) | ||
874 | { | ||
875 | struct r_port *info = container_of(port, struct r_port, port); | ||
876 | sSetDTR(&info->channel); | ||
877 | sSetRTS(&info->channel); | ||
878 | } | ||
879 | |||
873 | /* info->port.count is considered critical, protected by spinlocks. */ | 880 | /* info->port.count is considered critical, protected by spinlocks. */ |
874 | static int block_til_ready(struct tty_struct *tty, struct file *filp, | 881 | static int block_til_ready(struct tty_struct *tty, struct file *filp, |
875 | struct r_port *info) | 882 | struct r_port *info) |
@@ -928,10 +935,8 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, | |||
928 | spin_unlock_irqrestore(&info->slock, flags); | 935 | spin_unlock_irqrestore(&info->slock, flags); |
929 | 936 | ||
930 | while (1) { | 937 | while (1) { |
931 | if (tty->termios->c_cflag & CBAUD) { | 938 | if (tty->termios->c_cflag & CBAUD) |
932 | sSetDTR(&info->channel); | 939 | tty_port_raise_dtr_rts(port); |
933 | sSetRTS(&info->channel); | ||
934 | } | ||
935 | set_current_state(TASK_INTERRUPTIBLE); | 940 | set_current_state(TASK_INTERRUPTIBLE); |
936 | if (tty_hung_up_p(filp) || !(info->flags & ROCKET_INITIALIZED)) { | 941 | if (tty_hung_up_p(filp) || !(info->flags & ROCKET_INITIALIZED)) { |
937 | if (info->flags & ROCKET_HUP_NOTIFY) | 942 | if (info->flags & ROCKET_HUP_NOTIFY) |
@@ -2381,6 +2386,7 @@ static const struct tty_operations rocket_ops = { | |||
2381 | 2386 | ||
2382 | static const struct tty_port_operations rocket_port_ops = { | 2387 | static const struct tty_port_operations rocket_port_ops = { |
2383 | .carrier_raised = carrier_raised, | 2388 | .carrier_raised = carrier_raised, |
2389 | .raise_dtr_rts = raise_dtr_rts, | ||
2384 | }; | 2390 | }; |
2385 | 2391 | ||
2386 | /* | 2392 | /* |