diff options
Diffstat (limited to 'drivers/tty/rocket.c')
-rw-r--r-- | drivers/tty/rocket.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/drivers/tty/rocket.c b/drivers/tty/rocket.c index 5848a767001a..8073cc0dff59 100644 --- a/drivers/tty/rocket.c +++ b/drivers/tty/rocket.c | |||
@@ -315,9 +315,8 @@ static inline int rocket_paranoia_check(struct r_port *info, | |||
315 | * that receive data is present on a serial port. Pulls data from FIFO, moves it into the | 315 | * that receive data is present on a serial port. Pulls data from FIFO, moves it into the |
316 | * tty layer. | 316 | * tty layer. |
317 | */ | 317 | */ |
318 | static void rp_do_receive(struct r_port *info, | 318 | static void rp_do_receive(struct r_port *info, CHANNEL_t *cp, |
319 | struct tty_struct *tty, | 319 | unsigned int ChanStatus) |
320 | CHANNEL_t * cp, unsigned int ChanStatus) | ||
321 | { | 320 | { |
322 | unsigned int CharNStat; | 321 | unsigned int CharNStat; |
323 | int ToRecv, wRecv, space; | 322 | int ToRecv, wRecv, space; |
@@ -416,7 +415,7 @@ static void rp_do_receive(struct r_port *info, | |||
416 | cbuf[ToRecv - 1] = sInB(sGetTxRxDataIO(cp)); | 415 | cbuf[ToRecv - 1] = sInB(sGetTxRxDataIO(cp)); |
417 | } | 416 | } |
418 | /* Push the data up to the tty layer */ | 417 | /* Push the data up to the tty layer */ |
419 | tty_flip_buffer_push(tty); | 418 | tty_flip_buffer_push(&info->port); |
420 | } | 419 | } |
421 | 420 | ||
422 | /* | 421 | /* |
@@ -495,7 +494,6 @@ static void rp_do_transmit(struct r_port *info) | |||
495 | static void rp_handle_port(struct r_port *info) | 494 | static void rp_handle_port(struct r_port *info) |
496 | { | 495 | { |
497 | CHANNEL_t *cp; | 496 | CHANNEL_t *cp; |
498 | struct tty_struct *tty; | ||
499 | unsigned int IntMask, ChanStatus; | 497 | unsigned int IntMask, ChanStatus; |
500 | 498 | ||
501 | if (!info) | 499 | if (!info) |
@@ -506,12 +504,7 @@ static void rp_handle_port(struct r_port *info) | |||
506 | "info->flags & NOT_INIT\n"); | 504 | "info->flags & NOT_INIT\n"); |
507 | return; | 505 | return; |
508 | } | 506 | } |
509 | tty = tty_port_tty_get(&info->port); | 507 | |
510 | if (!tty) { | ||
511 | printk(KERN_WARNING "rp: WARNING: rp_handle_port called with " | ||
512 | "tty==NULL\n"); | ||
513 | return; | ||
514 | } | ||
515 | cp = &info->channel; | 508 | cp = &info->channel; |
516 | 509 | ||
517 | IntMask = sGetChanIntID(cp) & info->intmask; | 510 | IntMask = sGetChanIntID(cp) & info->intmask; |
@@ -520,7 +513,7 @@ static void rp_handle_port(struct r_port *info) | |||
520 | #endif | 513 | #endif |
521 | ChanStatus = sGetChanStatus(cp); | 514 | ChanStatus = sGetChanStatus(cp); |
522 | if (IntMask & RXF_TRIG) { /* Rx FIFO trigger level */ | 515 | if (IntMask & RXF_TRIG) { /* Rx FIFO trigger level */ |
523 | rp_do_receive(info, tty, cp, ChanStatus); | 516 | rp_do_receive(info, cp, ChanStatus); |
524 | } | 517 | } |
525 | if (IntMask & DELTA_CD) { /* CD change */ | 518 | if (IntMask & DELTA_CD) { /* CD change */ |
526 | #if (defined(ROCKET_DEBUG_OPEN) || defined(ROCKET_DEBUG_INTR) || defined(ROCKET_DEBUG_HANGUP)) | 519 | #if (defined(ROCKET_DEBUG_OPEN) || defined(ROCKET_DEBUG_INTR) || defined(ROCKET_DEBUG_HANGUP)) |
@@ -528,10 +521,15 @@ static void rp_handle_port(struct r_port *info) | |||
528 | (ChanStatus & CD_ACT) ? "on" : "off"); | 521 | (ChanStatus & CD_ACT) ? "on" : "off"); |
529 | #endif | 522 | #endif |
530 | if (!(ChanStatus & CD_ACT) && info->cd_status) { | 523 | if (!(ChanStatus & CD_ACT) && info->cd_status) { |
524 | struct tty_struct *tty; | ||
531 | #ifdef ROCKET_DEBUG_HANGUP | 525 | #ifdef ROCKET_DEBUG_HANGUP |
532 | printk(KERN_INFO "CD drop, calling hangup.\n"); | 526 | printk(KERN_INFO "CD drop, calling hangup.\n"); |
533 | #endif | 527 | #endif |
534 | tty_hangup(tty); | 528 | tty = tty_port_tty_get(&info->port); |
529 | if (tty) { | ||
530 | tty_hangup(tty); | ||
531 | tty_kref_put(tty); | ||
532 | } | ||
535 | } | 533 | } |
536 | info->cd_status = (ChanStatus & CD_ACT) ? 1 : 0; | 534 | info->cd_status = (ChanStatus & CD_ACT) ? 1 : 0; |
537 | wake_up_interruptible(&info->port.open_wait); | 535 | wake_up_interruptible(&info->port.open_wait); |
@@ -544,7 +542,6 @@ static void rp_handle_port(struct r_port *info) | |||
544 | printk(KERN_INFO "DSR change...\n"); | 542 | printk(KERN_INFO "DSR change...\n"); |
545 | } | 543 | } |
546 | #endif | 544 | #endif |
547 | tty_kref_put(tty); | ||
548 | } | 545 | } |
549 | 546 | ||
550 | /* | 547 | /* |