m68k: Mac IRQ prep

Make sure that there are no slot IRQs asserted before leaving the nubus
handler. If there are and we don't then the nubus gets wedged because this
prevents a CA1 transition, which means no more nubus IRQs.

Make the interrupt dispatch loops terminate sooner.

Explicitly initialise the VIA latches to make the code more easily understood.

Also some cleanups.

Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
diff --git a/arch/m68k/mac/oss.c b/arch/m68k/mac/oss.c
index 603d5cb..6399883 100644
--- a/arch/m68k/mac/oss.c
+++ b/arch/m68k/mac/oss.c
@@ -143,14 +143,18 @@
 #endif
 	/* There are only six slots on the OSS, not seven */
 
-	for (i = 0, irq_bit = 1 ; i < 6 ; i++, irq_bit <<= 1) {
+	i = 6;
+	irq_bit = 0x40;
+	do {
+		--i;
+		irq_bit >>= 1;
 		if (events & irq_bit) {
 			oss->irq_level[i] = OSS_IRQLEV_DISABLED;
 			oss->irq_pending &= ~irq_bit;
 			m68k_handle_int(NUBUS_SOURCE_BASE + i);
 			oss->irq_level[i] = OSS_IRQLEV_NUBUS;
 		}
-	}
+	} while(events & (irq_bit - 1));
 	return IRQ_HANDLED;
 }