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)
}
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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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 = (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. */
......
......@@ -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;
......
......@@ -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;
......
......@@ -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);
......
......@@ -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;
......
......@@ -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 = (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);
}
......
......@@ -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 */
}
......@@ -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 = (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);
}
......
......@@ -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;
......
......@@ -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 = (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);
}
......
......@@ -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 = (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);
}
......
......@@ -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)
{
}
......
......@@ -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
)
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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)
{
}
......
......@@ -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)
{
}
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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 *);
......
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