Skip to content

Commit

Permalink
PCI: Make the struct pci_dev * argument of pci_fixup_irqs const.
Browse files Browse the repository at this point in the history
Aside of the usual motivation for constification,  this function has a
history of being abused a hook for interrupt and other fixups so I turned
this function const ages ago in the MIPS code but it should be done
treewide.

Due to function pointer passing in varous places a few other functions
had to be constified as well.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
To: Anton Vorontsov <avorontsov@mvista.com>
To: Chris Metcalf <cmetcalf@tilera.com>
To: Colin Cross <ccross@android.com>
Acked-by: "David S. Miller" <davem@davemloft.net>
To: Eric Miao <eric.y.miao@gmail.com>
To: Erik Gilling <konkers@android.com>
Acked-by: Guan Xuetao <gxt@mprc.pku.edu.cn>
To: "H. Peter Anvin" <hpa@zytor.com>
To: Imre Kaloz <kaloz@openwrt.org>
To: Ingo Molnar <mingo@redhat.com>
To: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
To: Jesse Barnes <jbarnes@virtuousgeek.org>
To: Krzysztof Halasa <khc@pm.waw.pl>
To: Lennert Buytenhek <kernel@wantstofly.org>
To: Matt Turner <mattst88@gmail.com>
To: Nicolas Pitre <nico@fluxnic.net>
To: Olof Johansson <olof@lixom.net>
Acked-by: Paul Mundt <lethal@linux-sh.org>
To: Richard Henderson <rth@twiddle.net>
To: Russell King <linux@arm.linux.org.uk>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-alpha@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Cc: linux-pci@vger.kernel.org
Cc: linux-sh@vger.kernel.org
Cc: linux-tegra@vger.kernel.org
Cc: sparclinux@vger.kernel.org
Cc: x86@kernel.org
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
  • Loading branch information
Ralf Baechle authored and Jesse Barnes committed Jul 22, 2011
1 parent 05d3ac2 commit d534194
Show file tree
Hide file tree
Showing 101 changed files with 130 additions and 113 deletions.
2 changes: 1 addition & 1 deletion arch/alpha/kernel/sys_alcor.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ alcor_init_irq(void)
*/

static int __init
alcor_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
alcor_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
static char irq_tab[7][5] __initdata = {
/*INT INTA INTB INTC INTD */
Expand Down
6 changes: 3 additions & 3 deletions arch/alpha/kernel/sys_cabriolet.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ pc164_init_irq(void)
*/

static inline int __init
eb66p_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
eb66p_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
static char irq_tab[5][5] __initdata = {
/*INT INTA INTB INTC INTD */
Expand Down Expand Up @@ -205,7 +205,7 @@ eb66p_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
*/

static inline int __init
cabriolet_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
cabriolet_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
static char irq_tab[5][5] __initdata = {
/*INT INTA INTB INTC INTD */
Expand Down Expand Up @@ -289,7 +289,7 @@ cia_cab_init_pci(void)
*/

static inline int __init
alphapc164_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
alphapc164_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
static char irq_tab[7][5] __initdata = {
/*INT INTA INTB INTC INTD */
Expand Down
8 changes: 4 additions & 4 deletions arch/alpha/kernel/sys_dp264.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ isa_irq_fixup(struct pci_dev *dev, int irq)
}

static int __init
dp264_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
dp264_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
static char irq_tab[6][5] __initdata = {
/*INT INTA INTB INTC INTD */
Expand All @@ -404,7 +404,7 @@ dp264_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
}

static int __init
monet_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
monet_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
static char irq_tab[13][5] __initdata = {
/*INT INTA INTB INTC INTD */
Expand Down Expand Up @@ -466,7 +466,7 @@ monet_swizzle(struct pci_dev *dev, u8 *pinp)
}

static int __init
webbrick_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
webbrick_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
static char irq_tab[13][5] __initdata = {
/*INT INTA INTB INTC INTD */
Expand All @@ -488,7 +488,7 @@ webbrick_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
}

static int __init
clipper_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
clipper_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
static char irq_tab[7][5] __initdata = {
/*INT INTA INTB INTC INTD */
Expand Down
2 changes: 1 addition & 1 deletion arch/alpha/kernel/sys_eb64p.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ eb64p_init_irq(void)
*/

static int __init
eb64p_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
eb64p_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
static char irq_tab[5][5] __initdata = {
/*INT INTA INTB INTC INTD */
Expand Down
2 changes: 1 addition & 1 deletion arch/alpha/kernel/sys_eiger.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ eiger_init_irq(void)
}

static int __init
eiger_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
eiger_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
u8 irq_orig;

Expand Down
2 changes: 1 addition & 1 deletion arch/alpha/kernel/sys_marvel.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ marvel_init_irq(void)
}

static int
marvel_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
marvel_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
struct pci_controller *hose = dev->sysdata;
struct io7_port *io7_port = hose->sysdata;
Expand Down
2 changes: 1 addition & 1 deletion arch/alpha/kernel/sys_miata.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ miata_init_irq(void)
*/

static int __init
miata_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
miata_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
static char irq_tab[18][5] __initdata = {
/*INT INTA INTB INTC INTD */
Expand Down
2 changes: 1 addition & 1 deletion arch/alpha/kernel/sys_mikasa.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ mikasa_init_irq(void)
*/

static int __init
mikasa_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
mikasa_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
static char irq_tab[8][5] __initdata = {
/*INT INTA INTB INTC INTD */
Expand Down
2 changes: 1 addition & 1 deletion arch/alpha/kernel/sys_nautilus.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ nautilus_init_irq(void)
}

static int __init
nautilus_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
nautilus_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
/* Preserve the IRQ set up by the console. */

Expand Down
2 changes: 1 addition & 1 deletion arch/alpha/kernel/sys_noritake.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ noritake_init_irq(void)
*/

static int __init
noritake_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
noritake_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
static char irq_tab[15][5] __initdata = {
/*INT INTA INTB INTC INTD */
Expand Down
2 changes: 1 addition & 1 deletion arch/alpha/kernel/sys_rawhide.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ rawhide_init_irq(void)
*/

static int __init
rawhide_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
rawhide_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
static char irq_tab[5][5] __initdata = {
/*INT INTA INTB INTC INTD */
Expand Down
2 changes: 1 addition & 1 deletion arch/alpha/kernel/sys_ruffian.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ ruffian_kill_arch (int mode)
*/

static int __init
ruffian_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
ruffian_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
static char irq_tab[11][5] __initdata = {
/*INT INTA INTB INTC INTD */
Expand Down
2 changes: 1 addition & 1 deletion arch/alpha/kernel/sys_rx164.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ rx164_init_irq(void)
*/

static int __init
rx164_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
rx164_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
#if 0
static char irq_tab_pass1[6][5] __initdata = {
Expand Down
4 changes: 2 additions & 2 deletions arch/alpha/kernel/sys_sable.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ sable_init_irq(void)
*/

static int __init
sable_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
sable_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
static char irq_tab[9][5] __initdata = {
/*INT INTA INTB INTC INTD */
Expand Down Expand Up @@ -376,7 +376,7 @@ lynx_init_irq(void)
*/

static int __init
lynx_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
lynx_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
static char irq_tab[19][5] __initdata = {
/*INT INTA INTB INTC INTD */
Expand Down
4 changes: 2 additions & 2 deletions arch/alpha/kernel/sys_sio.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ sio_fixup_irq_levels(unsigned int level_bits)
}

static inline int __init
noname_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
noname_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
/*
* The Noname board has 5 PCI slots with each of the 4
Expand Down Expand Up @@ -185,7 +185,7 @@ noname_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
}

static inline int __init
p2k_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
p2k_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
static char irq_tab[][5] __initdata = {
/*INT A B C D */
Expand Down
2 changes: 1 addition & 1 deletion arch/alpha/kernel/sys_sx164.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ sx164_init_irq(void)
*/

static int __init
sx164_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
sx164_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
static char irq_tab[5][5] __initdata = {
/*INT INTA INTB INTC INTD */
Expand Down
4 changes: 2 additions & 2 deletions arch/alpha/kernel/sys_takara.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ takara_init_irq(void)
*/

static int __init
takara_map_irq_srm(struct pci_dev *dev, u8 slot, u8 pin)
takara_map_irq_srm(const struct pci_dev *dev, u8 slot, u8 pin)
{
static char irq_tab[15][5] __initdata = {
{ 16+3, 16+3, 16+3, 16+3, 16+3}, /* slot 6 == device 3 */
Expand Down Expand Up @@ -188,7 +188,7 @@ takara_map_irq_srm(struct pci_dev *dev, u8 slot, u8 pin)
}

static int __init
takara_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
takara_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
static char irq_tab[15][5] __initdata = {
{ 16+3, 16+3, 16+3, 16+3, 16+3}, /* slot 6 == device 3 */
Expand Down
2 changes: 1 addition & 1 deletion arch/alpha/kernel/sys_titan.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ titan_late_init(void)
}

static int __devinit
titan_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
titan_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
u8 intline;
int irq;
Expand Down
2 changes: 1 addition & 1 deletion arch/alpha/kernel/sys_wildfire.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ wildfire_device_interrupt(unsigned long vector)
*/

static int __init
wildfire_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
wildfire_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
static char irq_tab[8][5] __initdata = {
/*INT INTA INTB INTC INTD */
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/common/it8152.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ void it8152_irq_demux(unsigned int irq, struct irq_desc *desc)
}

/* mapping for on-chip devices */
int __init it8152_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
int __init it8152_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
if ((dev->vendor == PCI_VENDOR_ID_ITE) &&
(dev->device == PCI_DEVICE_ID_ITE_8152)) {
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/include/asm/hardware/it8152.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ struct pci_sys_data;

extern void it8152_irq_demux(unsigned int irq, struct irq_desc *desc);
extern void it8152_init_irq(void);
extern int it8152_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin);
extern int it8152_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin);
extern int it8152_pci_setup(int nr, struct pci_sys_data *sys);
extern struct pci_bus *it8152_pci_scan_bus(int nr, struct pci_sys_data *sys);

Expand Down
4 changes: 2 additions & 2 deletions arch/arm/include/asm/mach/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct hw_pci {
void (*preinit)(void);
void (*postinit)(void);
u8 (*swizzle)(struct pci_dev *dev, u8 *pin);
int (*map_irq)(struct pci_dev *dev, u8 slot, u8 pin);
int (*map_irq)(const struct pci_dev *dev, u8 slot, u8 pin);
};

/*
Expand All @@ -44,7 +44,7 @@ struct pci_sys_data {
/* Bridge swizzling */
u8 (*swizzle)(struct pci_dev *, u8 *);
/* IRQ mapping */
int (*map_irq)(struct pci_dev *, u8, u8);
int (*map_irq)(const struct pci_dev *, u8, u8);
struct hw_pci *hw;
void *private_data; /* platform controller private data */
};
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/kernel/bios32.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ static u8 __devinit pcibios_swizzle(struct pci_dev *dev, u8 *pin)
/*
* Map a slot/pin to an IRQ.
*/
static int pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
static int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
struct pci_sys_data *sys = dev->sysdata;
int irq = -1;
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-cns3xxx/pcie.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ static struct pci_bus *cns3xxx_pci_scan_bus(int nr, struct pci_sys_data *sys)
return pci_scan_bus(sys->busnr, &cns3xxx_pcie_ops, sys);
}

static int cns3xxx_pcie_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
static int cns3xxx_pcie_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
struct cns3xxx_pcie *cnspci = pdev_to_cnspci(dev);
int irq = cnspci->irqs[slot];
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-dove/pcie.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ dove_pcie_scan_bus(int nr, struct pci_sys_data *sys)
return bus;
}

static int __init dove_pcie_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
static int __init dove_pcie_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
struct pcie_port *pp = bus_to_port(dev->bus->number);

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-footbridge/cats-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/* cats host-specific stuff */
static int irqmap_cats[] __initdata = { IRQ_PCI, IRQ_IN0, IRQ_IN1, IRQ_IN3 };

static int __init cats_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
static int __init cats_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
if (dev->irq >= 255)
return -1; /* not a valid interrupt. */
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-footbridge/ebsa285-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

static int irqmap_ebsa285[] __initdata = { IRQ_IN3, IRQ_IN1, IRQ_IN0, IRQ_PCI };

static int __init ebsa285_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
static int __init ebsa285_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
if (dev->vendor == PCI_VENDOR_ID_CONTAQ &&
dev->device == PCI_DEVICE_ID_CONTAQ_82C693)
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-footbridge/netwinder-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* We now use the slot ID instead of the device identifiers to select
* which interrupt is routed where.
*/
static int __init netwinder_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
static int __init netwinder_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
switch (slot) {
case 0: /* host bridge */
Expand Down
3 changes: 2 additions & 1 deletion arch/arm/mach-footbridge/personal-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ static int irqmap_personal_server[] __initdata = {
IRQ_DOORBELLHOST, IRQ_DMA1, IRQ_DMA2, IRQ_PCI
};

static int __init personal_server_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
static int __init personal_server_map_irq(const struct pci_dev *dev, u8 slot,
u8 pin)
{
unsigned char line;

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-integrator/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ static int irq_tab[4] __initdata = {
* map the specified device/slot/pin to an IRQ. This works out such
* that slot 9 pin 1 is INT0, pin 2 is INT1, and slot 10 pin 1 is INT1.
*/
static int __init integrator_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
static int __init integrator_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
int intnr = ((slot - 9) + (pin - 1)) & 3;

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-iop13xx/iq81340mc.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
extern int init_atu; /* Flag to select which ATU(s) to initialize / disable */

static int __init
iq81340mc_pcix_map_irq(struct pci_dev *dev, u8 idsel, u8 pin)
iq81340mc_pcix_map_irq(const struct pci_dev *dev, u8 idsel, u8 pin)
{
switch (idsel) {
case 1:
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-iop13xx/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ static int iop13xx_atue_pci_status(int clear)
}

static int
iop13xx_pcie_map_irq(struct pci_dev *dev, u8 idsel, u8 pin)
iop13xx_pcie_map_irq(const struct pci_dev *dev, u8 idsel, u8 pin)
{
WARN_ON(idsel != 0);

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-iop32x/em7210.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void __init em7210_map_io(void)
#define INTD IRQ_IOP32X_XINT3

static int __init
em7210_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
em7210_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
static int pci_irq_table[][4] = {
/*
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-iop32x/glantank.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void __init glantank_map_io(void)
#define INTD IRQ_IOP32X_XINT3

static int __init
glantank_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
glantank_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
static int pci_irq_table[][4] = {
/*
Expand Down
Loading

0 comments on commit d534194

Please sign in to comment.