Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[MIPS] PCI: Make dev pointer argument of pcibios_map_irq const.

This is to break the code of people who think they are supposed to scribble
into the pci device structure - it's off limits.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

+29 -28
+1 -1
arch/mips/pci/fixup-atlas.c
··· 58 58 {0, 0, 0, 0, 0 } /* 21: Unused */ 59 59 }; 60 60 61 - int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 61 + int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 62 62 { 63 63 return irq_tab[slot][pin]; 64 64 }
+1 -1
arch/mips/pci/fixup-au1000.c
··· 35 35 36 36 extern char irq_tab_alchemy[][5]; 37 37 38 - int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 38 + int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 39 39 { 40 40 return irq_tab_alchemy[slot][pin]; 41 41 }
+1 -1
arch/mips/pci/fixup-capcella.c
··· 38 38 [14] = { -1, INTA, INTB, INTC, INTD } 39 39 }; 40 40 41 - int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 41 + int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 42 42 { 43 43 return irq_tab_capcella[slot][pin]; 44 44 }
+1 -1
arch/mips/pci/fixup-cobalt.c
··· 161 161 [COBALT_PCICONF_ETH1] = COBALT_ETH1_IRQ 162 162 }; 163 163 164 - int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 164 + int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 165 165 { 166 166 if (cobalt_board_id < COBALT_BRD_ID_QUBE2) 167 167 return irq_tab_qube1[slot];
+1 -1
arch/mips/pci/fixup-emma2rh.c
··· 89 89 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NEC, PCI_DEVICE_ID_NEC_EMMA2RH, 90 90 emma2rh_pci_host_fixup); 91 91 92 - int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 92 + int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 93 93 { 94 94 return irq_map[slot][pin]; 95 95 }
+1 -1
arch/mips/pci/fixup-excite.c
··· 21 21 #include <linux/pci.h> 22 22 #include <excite.h> 23 23 24 - int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 24 + int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 25 25 { 26 26 if (pin == 0) 27 27 return -1;
+1 -1
arch/mips/pci/fixup-ip32.c
··· 39 39 * irqs. I suppose a device without a pin A will thank us for doing it 40 40 * right if there exists such a broken piece of crap. 41 41 */ 42 - int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 42 + int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 43 43 { 44 44 return irq_tab_mace[slot][pin]; 45 45 }
+1 -1
arch/mips/pci/fixup-jmr3927.c
··· 33 33 34 34 #include <asm/jmr3927/jmr3927.h> 35 35 36 - int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 36 + int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 37 37 { 38 38 unsigned char irq = pin; 39 39
+1 -1
arch/mips/pci/fixup-malta.c
··· 36 36 {0, PCID, PCIA, PCIB, PCIC } /* 21: PCI Slot 4 */ 37 37 }; 38 38 39 - int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 39 + int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 40 40 { 41 41 int virq; 42 42 virq = irq_tab[slot][pin];
+1 -1
arch/mips/pci/fixup-mpc30x.c
··· 34 34 [29] = MQ200_IRQ, 35 35 }; 36 36 37 - int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 37 + int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 38 38 { 39 39 if (slot == 30) 40 40 return internal_func_irqs[PCI_FUNC(dev->devfn)];
+1 -1
arch/mips/pci/fixup-ocelot-c.c
··· 19 19 #include <linux/kernel.h> 20 20 #include <linux/init.h> 21 21 22 - int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 22 + int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 23 23 { 24 24 int bus = dev->bus->number; 25 25
+1 -1
arch/mips/pci/fixup-ocelot3.c
··· 23 23 return 0; 24 24 } 25 25 26 - int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 26 + int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 27 27 { 28 28 int bus = dev->bus->number; 29 29
+1 -1
arch/mips/pci/fixup-pnx8550.c
··· 45 45 /* nothing to do here */ 46 46 } 47 47 48 - int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 48 + int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 49 49 { 50 50 return pnx8550_irq_tab[slot][pin]; 51 51 }
+1 -1
arch/mips/pci/fixup-rbtx4927.c
··· 119 119 return irq; 120 120 } 121 121 122 - int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 122 + int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 123 123 { 124 124 unsigned char irq; 125 125
+1 -1
arch/mips/pci/fixup-sni.c
··· 120 120 return (csmsr & 0xa0) == 0x20; 121 121 } 122 122 123 - int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 123 + int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 124 124 { 125 125 switch (sni_brd_type) { 126 126 case SNI_BRD_PCI_TOWER:
+1 -1
arch/mips/pci/fixup-tb0219.c
··· 23 23 24 24 #include <asm/vr41xx/tb0219.h> 25 25 26 - int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 26 + int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 27 27 { 28 28 int irq = -1; 29 29
+1 -1
arch/mips/pci/fixup-tb0226.c
··· 23 23 #include <asm/vr41xx/giu.h> 24 24 #include <asm/vr41xx/tb0226.h> 25 25 26 - int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 26 + int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 27 27 { 28 28 int irq = -1; 29 29
+1 -1
arch/mips/pci/fixup-tb0287.c
··· 22 22 23 23 #include <asm/vr41xx/tb0287.h> 24 24 25 - int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 25 + int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 26 26 { 27 27 unsigned char bus; 28 28 int irq = -1;
+1 -1
arch/mips/pci/fixup-tx4938.c
··· 69 69 return irq; 70 70 } 71 71 72 - int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 72 + int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 73 73 { 74 74 unsigned char irq = 0; 75 75
+1 -1
arch/mips/pci/fixup-vr4133.c
··· 169 169 } 170 170 #endif 171 171 172 - int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 172 + int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 173 173 { 174 174 extern int pci_probe_only; 175 175 pci_probe_only = 1;
+1 -1
arch/mips/pci/fixup-wrppmc.c
··· 25 25 [6] = {0, WRPPMC_PCI_INTA_IRQ, 0, 0, 0}, 26 26 }; 27 27 28 - int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 28 + int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 29 29 { 30 30 return pci_irq_tab[slot][pin]; 31 31 }
+1 -1
arch/mips/pci/fixup-yosemite.c
··· 26 26 #include <linux/init.h> 27 27 #include <linux/pci.h> 28 28 29 - int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 29 + int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 30 30 { 31 31 if (pin == 0) 32 32 return -1;
+2 -1
arch/mips/pci/pci-bcm1480.c
··· 74 74 *(u32 *)(cfg_space + (addr & ~3)) = data; 75 75 } 76 76 77 - int pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 77 + int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 78 78 { 79 + This is b0rked. 79 80 return dev->irq; 80 81 } 81 82
+1 -1
arch/mips/pci/pci-ddb5477.c
··· 131 131 /* SLOT: 20, AD:31 */ VRC5477_IRQ_IOPCI_INTA, /* vrc5477 usb host */ 132 132 }; 133 133 134 - int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 134 + int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 135 135 { 136 136 int slot_num; 137 137 unsigned char *slot_irq_map;
+1 -1
arch/mips/pci/pci-ip27.c
··· 134 134 * A given PCI device, in general, should be able to intr any of the cpus 135 135 * on any one of the hubs connected to its xbow. 136 136 */ 137 - int __devinit pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 137 + int __devinit pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 138 138 { 139 139 struct bridge_controller *bc = BRIDGE_CONTROLLER(dev->bus); 140 140 int irq = bc->pci_int[slot];
+1 -1
arch/mips/pci/pci-lasat.c
··· 64 64 #define LASATINT_PCIC 7 65 65 #define LASATINT_PCID 8 66 66 67 - int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 67 + int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 68 68 { 69 69 switch (slot) { 70 70 case 1:
+1 -1
arch/mips/pci/pci-sb1250.c
··· 84 84 *(u32 *) (cfg_space + (addr & ~3)) = data; 85 85 } 86 86 87 - int pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 87 + int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 88 88 { 89 89 return dev->irq; 90 90 }
+1 -1
include/asm-mips/pci.h
··· 56 56 /* 57 57 * board supplied pci irq fixup routine 58 58 */ 59 - extern int pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin); 59 + extern int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin); 60 60 61 61 62 62 /* Can be used to override the logic in pci_scan_bus for skipping