diff options
Diffstat (limited to 'drivers/tty/serial/pmac_zilog.c')
-rw-r--r-- | drivers/tty/serial/pmac_zilog.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/tty/serial/pmac_zilog.c b/drivers/tty/serial/pmac_zilog.c index 333c8d012b0e..b1785f58b6e3 100644 --- a/drivers/tty/serial/pmac_zilog.c +++ b/drivers/tty/serial/pmac_zilog.c | |||
@@ -227,19 +227,19 @@ static void pmz_interrupt_control(struct uart_pmac_port *uap, int enable) | |||
227 | write_zsreg(uap, R1, uap->curregs[1]); | 227 | write_zsreg(uap, R1, uap->curregs[1]); |
228 | } | 228 | } |
229 | 229 | ||
230 | static struct tty_struct *pmz_receive_chars(struct uart_pmac_port *uap) | 230 | static bool pmz_receive_chars(struct uart_pmac_port *uap) |
231 | { | 231 | { |
232 | struct tty_struct *tty = NULL; | 232 | struct tty_port *port; |
233 | unsigned char ch, r1, drop, error, flag; | 233 | unsigned char ch, r1, drop, error, flag; |
234 | int loops = 0; | 234 | int loops = 0; |
235 | 235 | ||
236 | /* Sanity check, make sure the old bug is no longer happening */ | 236 | /* Sanity check, make sure the old bug is no longer happening */ |
237 | if (uap->port.state == NULL || uap->port.state->port.tty == NULL) { | 237 | if (uap->port.state == NULL) { |
238 | WARN_ON(1); | 238 | WARN_ON(1); |
239 | (void)read_zsdata(uap); | 239 | (void)read_zsdata(uap); |
240 | return NULL; | 240 | return false; |
241 | } | 241 | } |
242 | tty = uap->port.state->port.tty; | 242 | port = &uap->port.state->port; |
243 | 243 | ||
244 | while (1) { | 244 | while (1) { |
245 | error = 0; | 245 | error = 0; |
@@ -309,10 +309,10 @@ static struct tty_struct *pmz_receive_chars(struct uart_pmac_port *uap) | |||
309 | 309 | ||
310 | if (uap->port.ignore_status_mask == 0xff || | 310 | if (uap->port.ignore_status_mask == 0xff || |
311 | (r1 & uap->port.ignore_status_mask) == 0) { | 311 | (r1 & uap->port.ignore_status_mask) == 0) { |
312 | tty_insert_flip_char(tty, ch, flag); | 312 | tty_insert_flip_char(port, ch, flag); |
313 | } | 313 | } |
314 | if (r1 & Rx_OVR) | 314 | if (r1 & Rx_OVR) |
315 | tty_insert_flip_char(tty, 0, TTY_OVERRUN); | 315 | tty_insert_flip_char(port, 0, TTY_OVERRUN); |
316 | next_char: | 316 | next_char: |
317 | /* We can get stuck in an infinite loop getting char 0 when the | 317 | /* We can get stuck in an infinite loop getting char 0 when the |
318 | * line is in a wrong HW state, we break that here. | 318 | * line is in a wrong HW state, we break that here. |
@@ -328,11 +328,11 @@ static struct tty_struct *pmz_receive_chars(struct uart_pmac_port *uap) | |||
328 | break; | 328 | break; |
329 | } | 329 | } |
330 | 330 | ||
331 | return tty; | 331 | return true; |
332 | flood: | 332 | flood: |
333 | pmz_interrupt_control(uap, 0); | 333 | pmz_interrupt_control(uap, 0); |
334 | pmz_error("pmz: rx irq flood !\n"); | 334 | pmz_error("pmz: rx irq flood !\n"); |
335 | return tty; | 335 | return true; |
336 | } | 336 | } |
337 | 337 | ||
338 | static void pmz_status_handle(struct uart_pmac_port *uap) | 338 | static void pmz_status_handle(struct uart_pmac_port *uap) |
@@ -453,7 +453,7 @@ static irqreturn_t pmz_interrupt(int irq, void *dev_id) | |||
453 | struct uart_pmac_port *uap_a; | 453 | struct uart_pmac_port *uap_a; |
454 | struct uart_pmac_port *uap_b; | 454 | struct uart_pmac_port *uap_b; |
455 | int rc = IRQ_NONE; | 455 | int rc = IRQ_NONE; |
456 | struct tty_struct *tty; | 456 | bool push; |
457 | u8 r3; | 457 | u8 r3; |
458 | 458 | ||
459 | uap_a = pmz_get_port_A(uap); | 459 | uap_a = pmz_get_port_A(uap); |
@@ -466,7 +466,7 @@ static irqreturn_t pmz_interrupt(int irq, void *dev_id) | |||
466 | pmz_debug("irq, r3: %x\n", r3); | 466 | pmz_debug("irq, r3: %x\n", r3); |
467 | #endif | 467 | #endif |
468 | /* Channel A */ | 468 | /* Channel A */ |
469 | tty = NULL; | 469 | push = false; |
470 | if (r3 & (CHAEXT | CHATxIP | CHARxIP)) { | 470 | if (r3 & (CHAEXT | CHATxIP | CHARxIP)) { |
471 | if (!ZS_IS_OPEN(uap_a)) { | 471 | if (!ZS_IS_OPEN(uap_a)) { |
472 | pmz_debug("ChanA interrupt while not open !\n"); | 472 | pmz_debug("ChanA interrupt while not open !\n"); |
@@ -477,21 +477,21 @@ static irqreturn_t pmz_interrupt(int irq, void *dev_id) | |||
477 | if (r3 & CHAEXT) | 477 | if (r3 & CHAEXT) |
478 | pmz_status_handle(uap_a); | 478 | pmz_status_handle(uap_a); |
479 | if (r3 & CHARxIP) | 479 | if (r3 & CHARxIP) |
480 | tty = pmz_receive_chars(uap_a); | 480 | push = pmz_receive_chars(uap_a); |
481 | if (r3 & CHATxIP) | 481 | if (r3 & CHATxIP) |
482 | pmz_transmit_chars(uap_a); | 482 | pmz_transmit_chars(uap_a); |
483 | rc = IRQ_HANDLED; | 483 | rc = IRQ_HANDLED; |
484 | } | 484 | } |
485 | skip_a: | 485 | skip_a: |
486 | spin_unlock(&uap_a->port.lock); | 486 | spin_unlock(&uap_a->port.lock); |
487 | if (tty != NULL) | 487 | if (push) |
488 | tty_flip_buffer_push(tty); | 488 | tty_flip_buffer_push(&uap->port.state->port); |
489 | 489 | ||
490 | if (!uap_b) | 490 | if (!uap_b) |
491 | goto out; | 491 | goto out; |
492 | 492 | ||
493 | spin_lock(&uap_b->port.lock); | 493 | spin_lock(&uap_b->port.lock); |
494 | tty = NULL; | 494 | push = false; |
495 | if (r3 & (CHBEXT | CHBTxIP | CHBRxIP)) { | 495 | if (r3 & (CHBEXT | CHBTxIP | CHBRxIP)) { |
496 | if (!ZS_IS_OPEN(uap_b)) { | 496 | if (!ZS_IS_OPEN(uap_b)) { |
497 | pmz_debug("ChanB interrupt while not open !\n"); | 497 | pmz_debug("ChanB interrupt while not open !\n"); |
@@ -502,15 +502,15 @@ static irqreturn_t pmz_interrupt(int irq, void *dev_id) | |||
502 | if (r3 & CHBEXT) | 502 | if (r3 & CHBEXT) |
503 | pmz_status_handle(uap_b); | 503 | pmz_status_handle(uap_b); |
504 | if (r3 & CHBRxIP) | 504 | if (r3 & CHBRxIP) |
505 | tty = pmz_receive_chars(uap_b); | 505 | push = pmz_receive_chars(uap_b); |
506 | if (r3 & CHBTxIP) | 506 | if (r3 & CHBTxIP) |
507 | pmz_transmit_chars(uap_b); | 507 | pmz_transmit_chars(uap_b); |
508 | rc = IRQ_HANDLED; | 508 | rc = IRQ_HANDLED; |
509 | } | 509 | } |
510 | skip_b: | 510 | skip_b: |
511 | spin_unlock(&uap_b->port.lock); | 511 | spin_unlock(&uap_b->port.lock); |
512 | if (tty != NULL) | 512 | if (push) |
513 | tty_flip_buffer_push(tty); | 513 | tty_flip_buffer_push(&uap->port.state->port); |
514 | 514 | ||
515 | out: | 515 | out: |
516 | return rc; | 516 | return rc; |