Commit 032d6c6e authored by Russell King's avatar Russell King

[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
parent a9d96a6e
...@@ -265,8 +265,8 @@ pcibios_fixup_bus(struct pci_bus *bus) ...@@ -265,8 +265,8 @@ pcibios_fixup_bus(struct pci_bus *bus)
} }
void void
pcibios_update_resource(struct pci_dev *dev, struct resource *parent, pcibios_update_resource(struct pci_dev *dev, struct resource *res,
struct resource *res, int resource) int resource)
{ {
struct pci_controller *hose = dev->sysdata; struct pci_controller *hose = dev->sysdata;
struct resource *root; struct resource *root;
......
...@@ -260,8 +260,8 @@ struct pci_fixup pcibios_fixups[] = { ...@@ -260,8 +260,8 @@ struct pci_fixup pcibios_fixups[] = {
}; };
void __devinit void __devinit
pcibios_update_resource(struct pci_dev *dev, struct resource *root, pcibios_update_resource(struct pci_dev *dev, struct resource *res,
struct resource *res, int resource) int resource)
{ {
struct pci_sys_data *sys = dev->sysdata; struct pci_sys_data *sys = dev->sysdata;
u32 val, check; u32 val, check;
......
...@@ -34,8 +34,8 @@ ...@@ -34,8 +34,8 @@
#include "pci.h" #include "pci.h"
void void
pcibios_update_resource(struct pci_dev *dev, struct resource *root, pcibios_update_resource(struct pci_dev *dev, struct resource *res,
struct resource *res, int resource) int resource)
{ {
u32 new, check; u32 new, check;
int reg; int reg;
......
...@@ -144,8 +144,8 @@ pcibios_fixup_bus (struct pci_bus *b) ...@@ -144,8 +144,8 @@ pcibios_fixup_bus (struct pci_bus *b)
} }
void __devinit void __devinit
pcibios_update_resource (struct pci_dev *dev, struct resource *root, pcibios_update_resource (struct pci_dev *dev, struct resource *res,
struct resource *res, int resource) int resource)
{ {
unsigned long where, size; unsigned long where, size;
u32 reg; u32 reg;
...@@ -153,7 +153,8 @@ pcibios_update_resource (struct pci_dev *dev, struct resource *root, ...@@ -153,7 +153,8 @@ pcibios_update_resource (struct pci_dev *dev, struct resource *root,
where = PCI_BASE_ADDRESS_0 + (resource * 4); where = PCI_BASE_ADDRESS_0 + (resource * 4);
size = res->end - res->start; size = res->end - res->start;
pci_read_config_dword(dev, where, &reg); pci_read_config_dword(dev, where, &reg);
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); pci_write_config_dword(dev, where, reg);
/* ??? FIXME -- record old value for shutdown. */ /* ??? FIXME -- record old value for shutdown. */
......
...@@ -341,8 +341,8 @@ int pcibios_enable_device(struct pci_dev *dev) ...@@ -341,8 +341,8 @@ int pcibios_enable_device(struct pci_dev *dev)
return pcibios_enable_resources(dev); return pcibios_enable_resources(dev);
} }
void pcibios_update_resource(struct pci_dev *dev, struct resource *root, void pcibios_update_resource(struct pci_dev *dev, struct resource *res,
struct resource *res, int resource) int resource)
{ {
u32 new, check; u32 new, check;
int reg; int reg;
......
...@@ -399,8 +399,8 @@ int pcibios_enable_device(struct pci_dev *dev) ...@@ -399,8 +399,8 @@ int pcibios_enable_device(struct pci_dev *dev)
return pcibios_enable_resources(dev); return pcibios_enable_resources(dev);
} }
void pcibios_update_resource(struct pci_dev *dev, struct resource *root, void pcibios_update_resource(struct pci_dev *dev, struct resource *res,
struct resource *res, int resource) int resource)
{ {
u32 new, check; u32 new, check;
int reg; int reg;
......
...@@ -172,8 +172,8 @@ pcibios_align_resource(void *data, struct resource *res, ...@@ -172,8 +172,8 @@ pcibios_align_resource(void *data, struct resource *res,
} }
void void
pcibios_update_resource(struct pci_dev *dev, struct resource *root, pcibios_update_resource(struct pci_dev *dev, struct resource *res,
struct resource *res, int resource) int resource)
{ {
/* this should not be called */ /* this should not be called */
MIPS_ASSERT(1 == 0); MIPS_ASSERT(1 == 0);
......
...@@ -785,8 +785,8 @@ int pcibios_enable_device(struct pci_dev *dev) ...@@ -785,8 +785,8 @@ int pcibios_enable_device(struct pci_dev *dev)
return pcibios_enable_resources(dev); return pcibios_enable_resources(dev);
} }
void pcibios_update_resource(struct pci_dev *dev, struct resource *root, void pcibios_update_resource(struct pci_dev *dev, struct resource *res,
struct resource *res, int resource) int resource)
{ {
u32 new, check; u32 new, check;
int reg; int reg;
......
...@@ -197,8 +197,8 @@ pcibios_setup(char *str) ...@@ -197,8 +197,8 @@ pcibios_setup(char *str)
} }
void __init void __init
pcibios_update_resource(struct pci_dev *dev, struct resource *root, pcibios_update_resource(struct pci_dev *dev, struct resource *res,
struct resource *res, int resource) int resource)
{ {
unsigned long where, size; unsigned long where, size;
u32 reg; u32 reg;
...@@ -206,7 +206,8 @@ pcibios_update_resource(struct pci_dev *dev, struct resource *root, ...@@ -206,7 +206,8 @@ pcibios_update_resource(struct pci_dev *dev, struct resource *root,
where = PCI_BASE_ADDRESS_0 + (resource * 4); where = PCI_BASE_ADDRESS_0 + (resource * 4);
size = res->end - res->start; size = res->end - res->start;
pci_read_config_dword(dev, where, &reg); pci_read_config_dword(dev, where, &reg);
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); pci_write_config_dword(dev, where, reg);
} }
......
...@@ -168,8 +168,8 @@ pcibios_align_resource(void *data, struct resource *res, ...@@ -168,8 +168,8 @@ pcibios_align_resource(void *data, struct resource *res,
} }
void void
pcibios_update_resource(struct pci_dev *dev, struct resource *root, pcibios_update_resource(struct pci_dev *dev, struct resource *res,
struct resource *res, int resource) int resource)
{ {
/* this should not be called */ /* this should not be called */
} }
...@@ -249,8 +249,8 @@ struct pci_fixup pcibios_fixups[] = { ...@@ -249,8 +249,8 @@ struct pci_fixup pcibios_fixups[] = {
}; };
void __init void __init
pcibios_update_resource(struct pci_dev *dev, struct resource *root, pcibios_update_resource(struct pci_dev *dev, struct resource *res,
struct resource *res, int resource) int resource)
{ {
unsigned long where, size; unsigned long where, size;
u32 reg; u32 reg;
...@@ -258,7 +258,8 @@ pcibios_update_resource(struct pci_dev *dev, struct resource *root, ...@@ -258,7 +258,8 @@ pcibios_update_resource(struct pci_dev *dev, struct resource *root,
where = PCI_BASE_ADDRESS_0 + (resource * 4); where = PCI_BASE_ADDRESS_0 + (resource * 4);
size = res->end - res->start; size = res->end - res->start;
pci_read_config_dword(dev, where, &reg); pci_read_config_dword(dev, where, &reg);
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); pci_write_config_dword(dev, where, reg);
} }
......
...@@ -138,8 +138,8 @@ pcibios_fixup_bus(struct pci_bus *b) ...@@ -138,8 +138,8 @@ pcibios_fixup_bus(struct pci_bus *b)
} }
void void
pcibios_update_resource(struct pci_dev *dev, struct resource *root, pcibios_update_resource(struct pci_dev *dev, struct resource *res,
struct resource *res, int resource) int resource)
{ {
u32 new, check; u32 new, check;
int reg; int reg;
......
...@@ -308,8 +308,8 @@ struct pci_fixup pcibios_fixups[] = { ...@@ -308,8 +308,8 @@ struct pci_fixup pcibios_fixups[] = {
}; };
void __init void __init
pcibios_update_resource(struct pci_dev *dev, struct resource *root, pcibios_update_resource(struct pci_dev *dev, struct resource *res,
struct resource *res, int resource) int resource)
{ {
unsigned long where, size; unsigned long where, size;
u32 reg; u32 reg;
...@@ -317,7 +317,8 @@ pcibios_update_resource(struct pci_dev *dev, struct resource *root, ...@@ -317,7 +317,8 @@ pcibios_update_resource(struct pci_dev *dev, struct resource *root,
where = PCI_BASE_ADDRESS_0 + (resource * 4); where = PCI_BASE_ADDRESS_0 + (resource * 4);
size = res->end - res->start; size = res->end - res->start;
pci_read_config_dword(dev, where, &reg); pci_read_config_dword(dev, where, &reg);
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); pci_write_config_dword(dev, where, reg);
} }
......
...@@ -215,8 +215,8 @@ pcibios_update_irq(struct pci_dev *dev, int irq) ...@@ -215,8 +215,8 @@ pcibios_update_irq(struct pci_dev *dev, int irq)
} }
void __init void __init
pcibios_update_resource(struct pci_dev *dev, struct resource *root, pcibios_update_resource(struct pci_dev *dev, struct resource *res,
struct resource *res, int resource) int resource)
{ {
unsigned long where, size; unsigned long where, size;
u32 reg; u32 reg;
...@@ -224,7 +224,8 @@ pcibios_update_resource(struct pci_dev *dev, struct resource *root, ...@@ -224,7 +224,8 @@ pcibios_update_resource(struct pci_dev *dev, struct resource *root,
where = PCI_BASE_ADDRESS_0 + (resource * 4); where = PCI_BASE_ADDRESS_0 + (resource * 4);
size = res->end - res->start; size = res->end - res->start;
pci_read_config_dword(dev, where, &reg); pci_read_config_dword(dev, where, &reg);
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); pci_write_config_dword(dev, where, reg);
} }
......
...@@ -333,8 +333,8 @@ void __init pcibios_align_resource (void *data, struct resource *res, ...@@ -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, void __init pcibios_update_resource (struct pci_dev *dev, struct resource *res,
struct resource *res, int resource) int resource)
{ {
} }
......
...@@ -211,7 +211,6 @@ void __devinit pcibios_update_irq(struct pci_dev *dev, int irq) ...@@ -211,7 +211,6 @@ void __devinit pcibios_update_irq(struct pci_dev *dev, int irq)
void __devinit void __devinit
pcibios_update_resource( pcibios_update_resource(
struct pci_dev *dev, struct pci_dev *dev,
struct resource *root,
struct resource *res, struct resource *res,
int barnum int barnum
) )
......
...@@ -94,8 +94,8 @@ fixup_broken_pcnet32(struct pci_dev* dev) ...@@ -94,8 +94,8 @@ fixup_broken_pcnet32(struct pci_dev* dev)
} }
void void
pcibios_update_resource(struct pci_dev *dev, struct resource *root, pcibios_update_resource(struct pci_dev *dev, struct resource *res,
struct resource *res, int resource) int resource)
{ {
u32 new, check; u32 new, check;
int reg; int reg;
......
...@@ -133,8 +133,8 @@ void __devinit pcibios_fixup_pbus_ranges(struct pci_bus *pbus, ...@@ -133,8 +133,8 @@ void __devinit pcibios_fixup_pbus_ranges(struct pci_bus *pbus,
} }
void void
pcibios_update_resource(struct pci_dev *dev, struct resource *root, pcibios_update_resource(struct pci_dev *dev, struct resource *res,
struct resource *res, int resource) int resource)
{ {
u32 new, check; u32 new, check;
int reg; int reg;
......
...@@ -27,8 +27,8 @@ ...@@ -27,8 +27,8 @@
#include <linux/init.h> #include <linux/init.h>
void void
pcibios_update_resource(struct pci_dev *dev, struct resource *root, pcibios_update_resource(struct pci_dev *dev, struct resource *res,
struct resource *res, int resource) int resource)
{ {
u32 new, check; u32 new, check;
int reg; int reg;
......
...@@ -856,8 +856,8 @@ char * __init pcibios_setup(char *str) ...@@ -856,8 +856,8 @@ char * __init pcibios_setup(char *str)
/* /*
*/ */
void pcibios_update_resource(struct pci_dev *pdev, struct resource *res1, void pcibios_update_resource(struct pci_dev *pdev, struct resource *res,
struct resource *res2, int index) int index)
{ {
} }
......
...@@ -470,8 +470,8 @@ int pci_assign_resource(struct pci_dev *pdev, int resource) ...@@ -470,8 +470,8 @@ int pci_assign_resource(struct pci_dev *pdev, int resource)
return err; return err;
} }
void pcibios_update_resource(struct pci_dev *pdev, struct resource *res1, void pcibios_update_resource(struct pci_dev *pdev, struct resource *res,
struct resource *res2, int index) int index)
{ {
} }
......
...@@ -288,8 +288,7 @@ void __devinit pcibios_update_irq (struct pci_dev *dev, int irq) ...@@ -288,8 +288,7 @@ void __devinit pcibios_update_irq (struct pci_dev *dev, int irq)
} }
void __nomods_init void __nomods_init
pcibios_update_resource (struct pci_dev *dev, struct resource *root, pcibios_update_resource (struct pci_dev *dev, struct resource *r, int resource)
struct resource *r, int resource)
{ {
u32 new, check; u32 new, check;
int reg; int reg;
......
...@@ -34,8 +34,8 @@ ...@@ -34,8 +34,8 @@
#include "pci.h" #include "pci.h"
void void
pcibios_update_resource(struct pci_dev *dev, struct resource *root, pcibios_update_resource(struct pci_dev *dev, struct resource *res,
struct resource *res, int resource) int resource)
{ {
u32 new, check; u32 new, check;
int reg; int reg;
......
...@@ -90,9 +90,9 @@ int pci_assign_resource(struct pci_dev *dev, int resno) ...@@ -90,9 +90,9 @@ int pci_assign_resource(struct pci_dev *dev, int resno)
resno, res->start, res->end, dev->slot_name); resno, res->start, res->end, dev->slot_name);
} else { } else {
DBGC((KERN_ERR " got res[%lx:%lx] for resource %d of %s\n", 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. */ /* Update PCI config space. */
pcibios_update_resource(dev, res->parent, res, resno); pcibios_update_resource(dev, res, resno);
} }
return ret; return ret;
......
...@@ -531,8 +531,7 @@ char *pcibios_setup (char *str); ...@@ -531,8 +531,7 @@ char *pcibios_setup (char *str);
/* Used only when drivers/pci/setup.c is used */ /* Used only when drivers/pci/setup.c is used */
void pcibios_align_resource(void *, struct resource *, void pcibios_align_resource(void *, struct resource *,
unsigned long, unsigned long); unsigned long, unsigned long);
void pcibios_update_resource(struct pci_dev *, struct resource *, void pcibios_update_resource(struct pci_dev *, struct resource *, int);
struct resource *, int);
void pcibios_update_irq(struct pci_dev *, int irq); void pcibios_update_irq(struct pci_dev *, int irq);
void pcibios_fixup_pbus_ranges(struct pci_bus *, struct pbus_set_ranges_data *); void pcibios_fixup_pbus_ranges(struct pci_bus *, struct pbus_set_ranges_data *);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment