drivers/char/riscom8: clean up irq handling

Make irq handling more efficient, by passing board pointer via
request_irq() to our irq handler's dev_id argument.

This eliminates a table lookup upon each interrupt, and eliminates an
associated global variable (the table).

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>

+5 -11
+5 -11
drivers/char/riscom8.c
··· 79 79 80 80 #define RS_EVENT_WRITE_WAKEUP 0 81 81 82 - static struct riscom_board * IRQ_to_board[16]; 83 82 static struct tty_driver *riscom_driver; 84 83 85 84 static struct riscom_board rc_board[RC_NBOARD] = { ··· 536 537 } 537 538 538 539 /* The main interrupt processing routine */ 539 - static irqreturn_t rc_interrupt(int irq, void * dev_id) 540 + static irqreturn_t rc_interrupt(int dummy, void * dev_id) 540 541 { 541 542 unsigned char status; 542 543 unsigned char ack; 543 - struct riscom_board *bp; 544 + struct riscom_board *bp = dev_id; 544 545 unsigned long loop = 0; 545 546 int handled = 0; 546 - 547 - bp = IRQ_to_board[irq]; 548 547 549 548 if (!(bp->flags & RC_BOARD_ACTIVE)) 550 549 return IRQ_NONE; ··· 600 603 */ 601 604 602 605 /* Called with disabled interrupts */ 603 - static inline int rc_setup_board(struct riscom_board * bp) 606 + static int rc_setup_board(struct riscom_board * bp) 604 607 { 605 608 int error; 606 609 ··· 608 611 return 0; 609 612 610 613 error = request_irq(bp->irq, rc_interrupt, IRQF_DISABLED, 611 - "RISCom/8", NULL); 614 + "RISCom/8", bp); 612 615 if (error) 613 616 return error; 614 617 ··· 616 619 bp->DTR = ~0; 617 620 rc_out(bp, RC_DTR, bp->DTR); /* Drop DTR on all ports */ 618 621 619 - IRQ_to_board[bp->irq] = bp; 620 622 bp->flags |= RC_BOARD_ACTIVE; 621 623 622 624 return 0; 623 625 } 624 626 625 627 /* Called with disabled interrupts */ 626 - static inline void rc_shutdown_board(struct riscom_board *bp) 628 + static void rc_shutdown_board(struct riscom_board *bp) 627 629 { 628 630 if (!(bp->flags & RC_BOARD_ACTIVE)) 629 631 return; ··· 630 634 bp->flags &= ~RC_BOARD_ACTIVE; 631 635 632 636 free_irq(bp->irq, NULL); 633 - IRQ_to_board[bp->irq] = NULL; 634 637 635 638 bp->DTR = ~0; 636 639 rc_out(bp, RC_DTR, bp->DTR); /* Drop DTR on all ports */ ··· 1589 1594 if (!riscom_driver) 1590 1595 return -ENOMEM; 1591 1596 1592 - memset(IRQ_to_board, 0, sizeof(IRQ_to_board)); 1593 1597 riscom_driver->owner = THIS_MODULE; 1594 1598 riscom_driver->name = "ttyL"; 1595 1599 riscom_driver->major = RISCOM8_NORMAL_MAJOR;