m68k/mac: cleanup mac_clear_irq
authorFinn Thain <fthain@telegraphics.com.au>
Sun, 23 Oct 2011 14:11:13 +0000 (01:11 +1100)
committerGeert Uytterhoeven <geert@linux-m68k.org>
Sat, 10 Dec 2011 18:52:45 +0000 (19:52 +0100)
mac_clear_irq() is dead code and has been dead for as long as I can recall. On certain Mac models, certain irqs can't be cleared this way. Outside of irq dispatch, this code appears be unusable without busy loops or worse, and for irq dispatch we duplicate the same logic. Remove mac_clear_irq() and supporting code.

Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
arch/m68k/mac/baboon.c
arch/m68k/mac/macints.c
arch/m68k/mac/oss.c
arch/m68k/mac/psc.c
arch/m68k/mac/via.c

index b403924a1cad16f8ddeaf35da8003a3803041eca..b51ebaa54141e9aca5f9bea110501a93ba94b956 100644 (file)
@@ -124,13 +124,6 @@ void baboon_irq_disable(int irq)
                mac_irq_disable(irq_get_irq_data(IRQ_NUBUS_C));
 }
 
-void baboon_irq_clear(int irq)
-{
-       int irq_idx = IRQ_IDX(irq);
-
-       baboon->mb_ifr &= ~(1 << irq_idx);
-}
-
 int baboon_irq_pending(int irq)
 {
        int irq_idx = IRQ_IDX(irq);
index ba220b70ab8cc5ea150c54707f366de876afa934..8fdd990e04ba782c72d798965a5bae080ec0fd28 100644 (file)
@@ -239,7 +239,6 @@ void __init mac_init_IRQ(void)
 /*
  *  mac_irq_enable - enable an interrupt source
  * mac_irq_disable - disable an interrupt source
- *   mac_clear_irq - clears a pending interrupt
  * mac_irq_pending - returns the pending status of an IRQ (nonzero = pending)
  *
  * These routines are just dispatchers to the VIA/OSS/PSC routines.
@@ -315,38 +314,6 @@ void mac_irq_disable(struct irq_data *data)
        }
 }
 
-void mac_clear_irq(unsigned int irq)
-{
-       switch(IRQ_SRC(irq)) {
-       case 1:
-               via_irq_clear(irq);
-               break;
-       case 2:
-       case 7:
-               if (oss_present)
-                       oss_irq_clear(irq);
-               else
-                       via_irq_clear(irq);
-               break;
-       case 3:
-       case 5:
-       case 6:
-               if (psc_present)
-                       psc_irq_clear(irq);
-               else if (oss_present)
-                       oss_irq_clear(irq);
-               break;
-       case 4:
-               if (psc_present)
-                       psc_irq_clear(irq);
-               break;
-       case 8:
-               if (baboon_present)
-                       baboon_irq_clear(irq);
-               break;
-       }
-}
-
 int mac_irq_pending(unsigned int irq)
 {
        switch(IRQ_SRC(irq)) {
index a4c82dab9ff1acd3d9d5f90aafa8fb2c55a913f9..2344af31e83668ac44f8aec64f658932197a5b2c 100644 (file)
@@ -220,37 +220,6 @@ void oss_irq_disable(int irq) {
        }
 }
 
-/*
- * Clear an OSS interrupt
- *
- * Not sure if this works or not but it's the only method I could
- * think of based on the contents of the mac_oss structure.
- */
-
-void oss_irq_clear(int irq) {
-       /* FIXME: how to do this on OSS? */
-       switch(irq) {
-               case IRQ_MAC_SCC:
-                       oss->irq_pending &= ~OSS_IP_IOPSCC;
-                       break;
-               case IRQ_MAC_ADB:
-                       oss->irq_pending &= ~OSS_IP_IOPISM;
-                       break;
-               case IRQ_MAC_SCSI:
-                       oss->irq_pending &= ~OSS_IP_SCSI;
-                       break;
-               case IRQ_NUBUS_9:
-               case IRQ_NUBUS_A:
-               case IRQ_NUBUS_B:
-               case IRQ_NUBUS_C:
-               case IRQ_NUBUS_D:
-               case IRQ_NUBUS_E:
-                       irq -= NUBUS_SOURCE_BASE;
-                       oss->irq_pending &= ~(1 << irq);
-                       break;
-       }
-}
-
 /*
  * Check to see if a specific OSS interrupt is pending
  */
index e6c2d20f328d0599192994721fe72b3f1adaf90a..8dd71c555e939d223e49f61e5bd579fd3f564827 100644 (file)
@@ -181,14 +181,6 @@ void psc_irq_disable(int irq) {
        psc_write_byte(pIER, 1 << irq_idx);
 }
 
-void psc_irq_clear(int irq) {
-       int irq_src     = IRQ_SRC(irq);
-       int irq_idx     = IRQ_IDX(irq);
-       int pIFR        = pIERbase + (irq_src << 4);
-
-       psc_write_byte(pIFR, 1 << irq_idx);
-}
-
 int psc_irq_pending(int irq)
 {
        int irq_src     = IRQ_SRC(irq);
index f1600ad2662113979a16631613e6b8135c1a09e2..1c2bce7506b209960de7059520b87115c38274ae 100644 (file)
@@ -585,22 +585,6 @@ void via_irq_disable(int irq) {
        }
 }
 
-void via_irq_clear(int irq) {
-       int irq_src     = IRQ_SRC(irq);
-       int irq_idx     = IRQ_IDX(irq);
-       int irq_bit     = 1 << irq_idx;
-
-       if (irq_src == 1) {
-               via1[vIFR] = irq_bit;
-       } else if (irq_src == 2) {
-               via2[gIFR] = irq_bit | rbv_clear;
-       } else if (irq_src == 7) {
-               /* FIXME: There is no way to clear an individual nubus slot
-                * IRQ flag, other than getting the device to do it.
-                */
-       }
-}
-
 /*
  * Returns nonzero if an interrupt is pending on the given
  * VIA/IRQ combination.