[MIPS] BCM1480: Fix interrupt routing, take 2.
[safe/jmp/linux-2.6] / arch / mips / pci / pci-bcm1480.c
index d7b9e13..47f316c 100644 (file)
@@ -49,8 +49,8 @@
  * Macros for calculating offsets into config space given a device
  * structure or dev/fun/reg
  */
-#define CFGOFFSET(bus,devfn,where) (((bus)<<16)+((devfn)<<8)+(where))
-#define CFGADDR(bus,devfn,where)   CFGOFFSET((bus)->number,(devfn),where)
+#define CFGOFFSET(bus, devfn, where) (((bus)<<16)+((devfn)<<8)+(where))
+#define CFGADDR(bus, devfn, where)   CFGOFFSET((bus)->number, (devfn), where)
 
 static void *cfg_space;
 
@@ -74,9 +74,12 @@ static inline void WRITECFG32(u32 addr, u32 data)
        *(u32 *)(cfg_space + (addr & ~3)) = data;
 }
 
-int pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
+int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 {
-       return dev->irq;
+       if (pin == 0)
+               return -1;
+
+       return K_BCM1480_INT_PCI_INTA - 1 + pin;
 }
 
 /* Do platform specific device initialization at pci_enable_device() time */
@@ -254,7 +257,7 @@ static int __init bcm1480_pcibios_init(void)
        register_pci_controller(&bcm1480_controller);
 
 #ifdef CONFIG_VGA_CONSOLE
-       take_over_console(&vga_con,0,MAX_NR_CONSOLES-1,1);
+       take_over_console(&vga_con, 0, MAX_NR_CONSOLES-1, 1);
 #endif
        return 0;
 }