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/isicom.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/isicom.c')
-rw-r--r-- | drivers/char/isicom.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/char/isicom.c b/drivers/char/isicom.c index b3da4858fd4a..a449449e301c 100644 --- a/drivers/char/isicom.c +++ b/drivers/char/isicom.c | |||
@@ -328,11 +328,13 @@ static inline void drop_rts(struct isi_port *port) | |||
328 | } | 328 | } |
329 | 329 | ||
330 | /* card->lock MUST NOT be held */ | 330 | /* card->lock MUST NOT be held */ |
331 | static inline void raise_dtr_rts(struct isi_port *port) | 331 | |
332 | static void isicom_raise_dtr_rts(struct tty_port *port) | ||
332 | { | 333 | { |
333 | struct isi_board *card = port->card; | 334 | struct isi_port *ip = container_of(port, struct isi_port, port); |
335 | struct isi_board *card = ip->card; | ||
334 | unsigned long base = card->base; | 336 | unsigned long base = card->base; |
335 | u16 channel = port->channel; | 337 | u16 channel = ip->channel; |
336 | 338 | ||
337 | if (!lock_card(card)) | 339 | if (!lock_card(card)) |
338 | return; | 340 | return; |
@@ -340,7 +342,7 @@ static inline void raise_dtr_rts(struct isi_port *port) | |||
340 | outw(0x8000 | (channel << card->shift_count) | 0x02, base); | 342 | outw(0x8000 | (channel << card->shift_count) | 0x02, base); |
341 | outw(0x0f04, base); | 343 | outw(0x0f04, base); |
342 | InterruptTheCard(base); | 344 | InterruptTheCard(base); |
343 | port->status |= (ISI_DTR | ISI_RTS); | 345 | ip->status |= (ISI_DTR | ISI_RTS); |
344 | unlock_card(card); | 346 | unlock_card(card); |
345 | } | 347 | } |
346 | 348 | ||
@@ -881,7 +883,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp, | |||
881 | spin_unlock_irqrestore(&card->card_lock, flags); | 883 | spin_unlock_irqrestore(&card->card_lock, flags); |
882 | 884 | ||
883 | while (1) { | 885 | while (1) { |
884 | raise_dtr_rts(ip); | 886 | tty_port_raise_dtr_rts(port); |
885 | 887 | ||
886 | set_current_state(TASK_INTERRUPTIBLE); | 888 | set_current_state(TASK_INTERRUPTIBLE); |
887 | if (tty_hung_up_p(filp) || !(port->flags & ASYNC_INITIALIZED)) { | 889 | if (tty_hung_up_p(filp) || !(port->flags & ASYNC_INITIALIZED)) { |
@@ -1462,6 +1464,7 @@ static const struct tty_operations isicom_ops = { | |||
1462 | 1464 | ||
1463 | static const struct tty_port_operations isicom_port_ops = { | 1465 | static const struct tty_port_operations isicom_port_ops = { |
1464 | .carrier_raised = isicom_carrier_raised, | 1466 | .carrier_raised = isicom_carrier_raised, |
1467 | .raise_dtr_rts = isicom_raise_dtr_rts, | ||
1465 | }; | 1468 | }; |
1466 | 1469 | ||
1467 | static int __devinit reset_card(struct pci_dev *pdev, | 1470 | static int __devinit reset_card(struct pci_dev *pdev, |