diff options
| author | Russell King <rmk@flint.arm.linux.org.uk> | 2003-03-16 21:42:43 +0000 |
|---|---|---|
| committer | Russell King <rmk@flint.arm.linux.org.uk> | 2003-03-16 21:42:43 +0000 |
| commit | 032d6c6ef2b24013633f987cdf2d8fb88eadc202 (patch) | |
| tree | 985923c1e3e874f03cb164867aea0d9360994e67 | |
| parent | a9d96a6e1f57deea016cdf580d1fdee2ecef6df8 (diff) | |
[PCI] pci-7: Remove second argument to pcibios_update_resource()
Patch from Ivan Kokshaysky
remove the "parent" or "root" second argument to
pcibios_update_resource(). This highlights the following
architectures doing something wrong in their implementation:
- ia64
- mips it8172
- mips "generic mips boards"
- mips64 "generic mips boards"
- mips64 IP27
| -rw-r--r-- | arch/alpha/kernel/pci.c | 4 | ||||
| -rw-r--r-- | arch/arm/kernel/bios32.c | 4 | ||||
| -rw-r--r-- | arch/i386/pci/i386.c | 4 | ||||
| -rw-r--r-- | arch/ia64/pci/pci.c | 7 | ||||
| -rw-r--r-- | arch/mips/ddb5074/pci.c | 4 | ||||
| -rw-r--r-- | arch/mips/ddb5476/pci.c | 4 | ||||
| -rw-r--r-- | arch/mips/ddb5xxx/common/pci.c | 4 | ||||
| -rw-r--r-- | arch/mips/gt64120/common/pci.c | 4 | ||||
| -rw-r--r-- | arch/mips/ite-boards/generic/it8172_pci.c | 7 | ||||
| -rw-r--r-- | arch/mips/kernel/pci.c | 4 | ||||
| -rw-r--r-- | arch/mips/mips-boards/generic/pci.c | 7 | ||||
| -rw-r--r-- | arch/mips/sni/pci.c | 4 | ||||
| -rw-r--r-- | arch/mips64/mips-boards/generic/pci.c | 7 | ||||
| -rw-r--r-- | arch/mips64/sgi-ip27/ip27-pci.c | 7 | ||||
| -rw-r--r-- | arch/mips64/sgi-ip32/ip32-pci.c | 4 | ||||
| -rw-r--r-- | arch/parisc/kernel/pci.c | 1 | ||||
| -rw-r--r-- | arch/ppc/kernel/pci.c | 4 | ||||
| -rw-r--r-- | arch/ppc64/kernel/pci.c | 4 | ||||
| -rw-r--r-- | arch/sh/kernel/pcibios.c | 4 | ||||
| -rw-r--r-- | arch/sparc/kernel/pcic.c | 4 | ||||
| -rw-r--r-- | arch/sparc64/kernel/pci.c | 4 | ||||
| -rw-r--r-- | arch/v850/kernel/rte_mb_a_pci.c | 3 | ||||
| -rw-r--r-- | arch/x86_64/pci/x86-64.c | 4 | ||||
| -rw-r--r-- | drivers/pci/setup-res.c | 4 | ||||
| -rw-r--r-- | include/linux/pci.h | 3 |
25 files changed, 56 insertions, 54 deletions
diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c index 3b99a1d12878..81e079568688 100644 --- a/arch/alpha/kernel/pci.c +++ b/arch/alpha/kernel/pci.c @@ -265,8 +265,8 @@ pcibios_fixup_bus(struct pci_bus *bus) } void -pcibios_update_resource(struct pci_dev *dev, struct resource *parent, - struct resource *res, int resource) +pcibios_update_resource(struct pci_dev *dev, struct resource *res, + int resource) { struct pci_controller *hose = dev->sysdata; struct resource *root; diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c index 0498981652f5..8df79c2cdee3 100644 --- a/arch/arm/kernel/bios32.c +++ b/arch/arm/kernel/bios32.c @@ -260,8 +260,8 @@ struct pci_fixup pcibios_fixups[] = { }; void __devinit -pcibios_update_resource(struct pci_dev *dev, struct resource *root, - struct resource *res, int resource) +pcibios_update_resource(struct pci_dev *dev, struct resource *res, + int resource) { struct pci_sys_data *sys = dev->sysdata; u32 val, check; diff --git a/arch/i386/pci/i386.c b/arch/i386/pci/i386.c index 9cfc595855de..36e5d4e30bbc 100644 --- a/arch/i386/pci/i386.c +++ b/arch/i386/pci/i386.c @@ -34,8 +34,8 @@ #include "pci.h" void -pcibios_update_resource(struct pci_dev *dev, struct resource *root, - struct resource *res, int resource) +pcibios_update_resource(struct pci_dev *dev, struct resource *res, + int resource) { u32 new, check; int reg; diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c index c0e7bac3b123..84e49ffc52b1 100644 --- a/arch/ia64/pci/pci.c +++ b/arch/ia64/pci/pci.c @@ -144,8 +144,8 @@ pcibios_fixup_bus (struct pci_bus *b) } void __devinit -pcibios_update_resource (struct pci_dev *dev, struct resource *root, - struct resource *res, int resource) +pcibios_update_resource (struct pci_dev *dev, struct resource *res, + int resource) { unsigned long where, size; u32 reg; @@ -153,7 +153,8 @@ pcibios_update_resource (struct pci_dev *dev, struct resource *root, where = PCI_BASE_ADDRESS_0 + (resource * 4); size = res->end - res->start; pci_read_config_dword(dev, where, ®); - reg = (reg & size) | (((u32)(res->start - root->start)) & ~size); + /* FIXME - this doesn't work for PCI-PCI bridges. */ + reg = (reg & size) | (((u32)(res->start - res->parent->start)) & ~size); pci_write_config_dword(dev, where, reg); /* ??? FIXME -- record old value for shutdown. */ diff --git a/arch/mips/ddb5074/pci.c b/arch/mips/ddb5074/pci.c index 57a0b09ea24f..b97df65f4f3f 100644 --- a/arch/mips/ddb5074/pci.c +++ b/arch/mips/ddb5074/pci.c @@ -341,8 +341,8 @@ int pcibios_enable_device(struct pci_dev *dev) return pcibios_enable_resources(dev); } -void pcibios_update_resource(struct pci_dev *dev, struct resource *root, - struct resource *res, int resource) +void pcibios_update_resource(struct pci_dev *dev, struct resource *res, + int resource) { u32 new, check; int reg; diff --git a/arch/mips/ddb5476/pci.c b/arch/mips/ddb5476/pci.c index d8f2c6d57f0d..473aa79e4d65 100644 --- a/arch/mips/ddb5476/pci.c +++ b/arch/mips/ddb5476/pci.c @@ -399,8 +399,8 @@ int pcibios_enable_device(struct pci_dev *dev) return pcibios_enable_resources(dev); } -void pcibios_update_resource(struct pci_dev *dev, struct resource *root, - struct resource *res, int resource) +void pcibios_update_resource(struct pci_dev *dev, struct resource *res, + int resource) { u32 new, check; int reg; diff --git a/arch/mips/ddb5xxx/common/pci.c b/arch/mips/ddb5xxx/common/pci.c index 5c1e07f6edbb..c6a453cff051 100644 --- a/arch/mips/ddb5xxx/common/pci.c +++ b/arch/mips/ddb5xxx/common/pci.c @@ -172,8 +172,8 @@ pcibios_align_resource(void *data, struct resource *res, } void -pcibios_update_resource(struct pci_dev *dev, struct resource *root, - struct resource *res, int resource) +pcibios_update_resource(struct pci_dev *dev, struct resource *res, + int resource) { /* this should not be called */ MIPS_ASSERT(1 == 0); diff --git a/arch/mips/gt64120/common/pci.c b/arch/mips/gt64120/common/pci.c index c8615e9043a2..15517ff37104 100644 --- a/arch/mips/gt64120/common/pci.c +++ b/arch/mips/gt64120/common/pci.c @@ -785,8 +785,8 @@ int pcibios_enable_device(struct pci_dev *dev) return pcibios_enable_resources(dev); } -void pcibios_update_resource(struct pci_dev *dev, struct resource *root, - struct resource *res, int resource) +void pcibios_update_resource(struct pci_dev *dev, struct resource *res, + int resource) { u32 new, check; int reg; diff --git a/arch/mips/ite-boards/generic/it8172_pci.c b/arch/mips/ite-boards/generic/it8172_pci.c index 7a7075b1d728..7a9a942ca7df 100644 --- a/arch/mips/ite-boards/generic/it8172_pci.c +++ b/arch/mips/ite-boards/generic/it8172_pci.c @@ -197,8 +197,8 @@ pcibios_setup(char *str) } void __init -pcibios_update_resource(struct pci_dev *dev, struct resource *root, - struct resource *res, int resource) +pcibios_update_resource(struct pci_dev *dev, struct resource *res, + int resource) { unsigned long where, size; u32 reg; @@ -206,7 +206,8 @@ pcibios_update_resource(struct pci_dev *dev, struct resource *root, where = PCI_BASE_ADDRESS_0 + (resource * 4); size = res->end - res->start; pci_read_config_dword(dev, where, ®); - reg = (reg & size) | (((u32)(res->start - root->start)) & ~size); + /* FIXME - this doesn't work for PCI-PCI bridges. */ + reg = (reg & size) | (((u32)(res->start - res->parent->start)) & ~size); pci_write_config_dword(dev, where, reg); } diff --git a/arch/mips/kernel/pci.c b/arch/mips/kernel/pci.c index 81aea7026fa2..d6daceee99ba 100644 --- a/arch/mips/kernel/pci.c +++ b/arch/mips/kernel/pci.c @@ -168,8 +168,8 @@ pcibios_align_resource(void *data, struct resource *res, } void -pcibios_update_resource(struct pci_dev *dev, struct resource *root, - struct resource *res, int resource) +pcibios_update_resource(struct pci_dev *dev, struct resource *res, + int resource) { /* this should not be called */ } diff --git a/arch/mips/mips-boards/generic/pci.c b/arch/mips/mips-boards/generic/pci.c index c9e84b11d87e..36e90a299322 100644 --- a/arch/mips/mips-boards/generic/pci.c +++ b/arch/mips/mips-boards/generic/pci.c @@ -249,8 +249,8 @@ struct pci_fixup pcibios_fixups[] = { }; void __init -pcibios_update_resource(struct pci_dev *dev, struct resource *root, - struct resource *res, int resource) +pcibios_update_resource(struct pci_dev *dev, struct resource *res, + int resource) { unsigned long where, size; u32 reg; @@ -258,7 +258,8 @@ pcibios_update_resource(struct pci_dev *dev, struct resource *root, where = PCI_BASE_ADDRESS_0 + (resource * 4); size = res->end - res->start; pci_read_config_dword(dev, where, ®); - reg = (reg & size) | (((u32)(res->start - root->start)) & ~size); + /* FIXME - this doesn't work for PCI-PCI bridges. */ + reg = (reg & size) | (((u32)(res->start - res->parent->start)) & ~size); pci_write_config_dword(dev, where, reg); } diff --git a/arch/mips/sni/pci.c b/arch/mips/sni/pci.c index 008f36a4e4ed..26d0b20a7525 100644 --- a/arch/mips/sni/pci.c +++ b/arch/mips/sni/pci.c @@ -138,8 +138,8 @@ pcibios_fixup_bus(struct pci_bus *b) } void -pcibios_update_resource(struct pci_dev *dev, struct resource *root, - struct resource *res, int resource) +pcibios_update_resource(struct pci_dev *dev, struct resource *res, + int resource) { u32 new, check; int reg; diff --git a/arch/mips64/mips-boards/generic/pci.c b/arch/mips64/mips-boards/generic/pci.c index 4e377c3e9716..a0f42b33a175 100644 --- a/arch/mips64/mips-boards/generic/pci.c +++ b/arch/mips64/mips-boards/generic/pci.c @@ -308,8 +308,8 @@ struct pci_fixup pcibios_fixups[] = { }; void __init -pcibios_update_resource(struct pci_dev *dev, struct resource *root, - struct resource *res, int resource) +pcibios_update_resource(struct pci_dev *dev, struct resource *res, + int resource) { unsigned long where, size; u32 reg; @@ -317,7 +317,8 @@ pcibios_update_resource(struct pci_dev *dev, struct resource *root, where = PCI_BASE_ADDRESS_0 + (resource * 4); size = res->end - res->start; pci_read_config_dword(dev, where, ®); - reg = (reg & size) | (((u32)(res->start - root->start)) & ~size); + /* FIXME - this doesn't work for PCI-PCI bridges. */ + reg = (reg & size) | (((u32)(res->start - res->parent->start)) & ~size); pci_write_config_dword(dev, where, reg); } diff --git a/arch/mips64/sgi-ip27/ip27-pci.c b/arch/mips64/sgi-ip27/ip27-pci.c index 61decb894697..5b26dca1771e 100644 --- a/arch/mips64/sgi-ip27/ip27-pci.c +++ b/arch/mips64/sgi-ip27/ip27-pci.c @@ -215,8 +215,8 @@ pcibios_update_irq(struct pci_dev *dev, int irq) } void __init -pcibios_update_resource(struct pci_dev *dev, struct resource *root, - struct resource *res, int resource) +pcibios_update_resource(struct pci_dev *dev, struct resource *res, + int resource) { unsigned long where, size; u32 reg; @@ -224,7 +224,8 @@ pcibios_update_resource(struct pci_dev *dev, struct resource *root, where = PCI_BASE_ADDRESS_0 + (resource * 4); size = res->end - res->start; pci_read_config_dword(dev, where, ®); - reg = (reg & size) | (((u32)(res->start - root->start)) & ~size); + /* FIXME - this doesn't work for PCI-PCI bridges. */ + reg = (reg & size) | (((u32)(res->start - res->parent->start)) & ~size); pci_write_config_dword(dev, where, reg); } diff --git a/arch/mips64/sgi-ip32/ip32-pci.c b/arch/mips64/sgi-ip32/ip32-pci.c index f3f2be83974d..11fd67105e61 100644 --- a/arch/mips64/sgi-ip32/ip32-pci.c +++ b/arch/mips64/sgi-ip32/ip32-pci.c @@ -333,8 +333,8 @@ void __init pcibios_align_resource (void *data, struct resource *res, { } -void __init pcibios_update_resource (struct pci_dev *dev, struct resource *root, - struct resource *res, int resource) +void __init pcibios_update_resource (struct pci_dev *dev, struct resource *res, + int resource) { } diff --git a/arch/parisc/kernel/pci.c b/arch/parisc/kernel/pci.c index 52eeb2434cd7..a457f1d67c25 100644 --- a/arch/parisc/kernel/pci.c +++ b/arch/parisc/kernel/pci.c @@ -211,7 +211,6 @@ void __devinit pcibios_update_irq(struct pci_dev *dev, int irq) void __devinit pcibios_update_resource( struct pci_dev *dev, - struct resource *root, struct resource *res, int barnum ) diff --git a/arch/ppc/kernel/pci.c b/arch/ppc/kernel/pci.c index ee68f236114b..71effba667d2 100644 --- a/arch/ppc/kernel/pci.c +++ b/arch/ppc/kernel/pci.c @@ -94,8 +94,8 @@ fixup_broken_pcnet32(struct pci_dev* dev) } void -pcibios_update_resource(struct pci_dev *dev, struct resource *root, - struct resource *res, int resource) +pcibios_update_resource(struct pci_dev *dev, struct resource *res, + int resource) { u32 new, check; int reg; diff --git a/arch/ppc64/kernel/pci.c b/arch/ppc64/kernel/pci.c index 0b806985b431..fed8f78fd6bb 100644 --- a/arch/ppc64/kernel/pci.c +++ b/arch/ppc64/kernel/pci.c @@ -133,8 +133,8 @@ void __devinit pcibios_fixup_pbus_ranges(struct pci_bus *pbus, } void -pcibios_update_resource(struct pci_dev *dev, struct resource *root, - struct resource *res, int resource) +pcibios_update_resource(struct pci_dev *dev, struct resource *res, + int resource) { u32 new, check; int reg; diff --git a/arch/sh/kernel/pcibios.c b/arch/sh/kernel/pcibios.c index cfd0adb401fb..6f4d7b84c32d 100644 --- a/arch/sh/kernel/pcibios.c +++ b/arch/sh/kernel/pcibios.c @@ -27,8 +27,8 @@ #include <linux/init.h> void -pcibios_update_resource(struct pci_dev *dev, struct resource *root, - struct resource *res, int resource) +pcibios_update_resource(struct pci_dev *dev, struct resource *res, + int resource) { u32 new, check; int reg; diff --git a/arch/sparc/kernel/pcic.c b/arch/sparc/kernel/pcic.c index b7e3c63efd9f..9c1ebf20487c 100644 --- a/arch/sparc/kernel/pcic.c +++ b/arch/sparc/kernel/pcic.c @@ -856,8 +856,8 @@ char * __init pcibios_setup(char *str) /* */ -void pcibios_update_resource(struct pci_dev *pdev, struct resource *res1, - struct resource *res2, int index) +void pcibios_update_resource(struct pci_dev *pdev, struct resource *res, + int index) { } diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c index 89901b4bb74c..86288ba4e3c2 100644 --- a/arch/sparc64/kernel/pci.c +++ b/arch/sparc64/kernel/pci.c @@ -470,8 +470,8 @@ int pci_assign_resource(struct pci_dev *pdev, int resource) return err; } -void pcibios_update_resource(struct pci_dev *pdev, struct resource *res1, - struct resource *res2, int index) +void pcibios_update_resource(struct pci_dev *pdev, struct resource *res, + int index) { } diff --git a/arch/v850/kernel/rte_mb_a_pci.c b/arch/v850/kernel/rte_mb_a_pci.c index 6fc07ccd955e..56acfce6b449 100644 --- a/arch/v850/kernel/rte_mb_a_pci.c +++ b/arch/v850/kernel/rte_mb_a_pci.c @@ -288,8 +288,7 @@ void __devinit pcibios_update_irq (struct pci_dev *dev, int irq) } void __nomods_init -pcibios_update_resource (struct pci_dev *dev, struct resource *root, - struct resource *r, int resource) +pcibios_update_resource (struct pci_dev *dev, struct resource *r, int resource) { u32 new, check; int reg; diff --git a/arch/x86_64/pci/x86-64.c b/arch/x86_64/pci/x86-64.c index 9c29fa694796..f9ee1dd44061 100644 --- a/arch/x86_64/pci/x86-64.c +++ b/arch/x86_64/pci/x86-64.c @@ -34,8 +34,8 @@ #include "pci.h" void -pcibios_update_resource(struct pci_dev *dev, struct resource *root, - struct resource *res, int resource) +pcibios_update_resource(struct pci_dev *dev, struct resource *res, + int resource) { u32 new, check; int reg; diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c index 3331a411db7b..be89db151d90 100644 --- a/drivers/pci/setup-res.c +++ b/drivers/pci/setup-res.c @@ -90,9 +90,9 @@ int pci_assign_resource(struct pci_dev *dev, int resno) resno, res->start, res->end, dev->slot_name); } else { DBGC((KERN_ERR " got res[%lx:%lx] for resource %d of %s\n", - res->start, res->end, i, dev->dev.name)); + res->start, res->end, resno, dev->dev.name)); /* Update PCI config space. */ - pcibios_update_resource(dev, res->parent, res, resno); + pcibios_update_resource(dev, res, resno); } return ret; diff --git a/include/linux/pci.h b/include/linux/pci.h index 393417af2f89..0bc50220c102 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -531,8 +531,7 @@ char *pcibios_setup (char *str); /* Used only when drivers/pci/setup.c is used */ void pcibios_align_resource(void *, struct resource *, unsigned long, unsigned long); -void pcibios_update_resource(struct pci_dev *, struct resource *, - struct resource *, int); +void pcibios_update_resource(struct pci_dev *, struct resource *, int); void pcibios_update_irq(struct pci_dev *, int irq); void pcibios_fixup_pbus_ranges(struct pci_bus *, struct pbus_set_ranges_data *); |
