mirror of
https://github.com/raspberrypi/linux.git
synced 2026-01-04 10:21:00 +00:00
powerpc/pci: Make IO workarounds init implicit when first bus is registered
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
This commit is contained in:
committed by
Benjamin Herrenschmidt
parent
3cc30d0726
commit
d1109b7529
@@ -144,7 +144,19 @@ static void __iomem *iowa_ioremap(phys_addr_t addr, unsigned long size,
|
||||
return res;
|
||||
}
|
||||
|
||||
/* Regist new bus to support workaround */
|
||||
/* Enable IO workaround */
|
||||
static void __devinit io_workaround_init(void)
|
||||
{
|
||||
static int io_workaround_inited;
|
||||
|
||||
if (io_workaround_inited)
|
||||
return;
|
||||
ppc_pci_io = iowa_pci_io;
|
||||
ppc_md.ioremap = iowa_ioremap;
|
||||
io_workaround_inited = 1;
|
||||
}
|
||||
|
||||
/* Register new bus to support workaround */
|
||||
void __devinit iowa_register_bus(struct pci_controller *phb,
|
||||
struct ppc_pci_io *ops,
|
||||
int (*initfunc)(struct iowa_bus *, void *), void *data)
|
||||
@@ -152,6 +164,8 @@ void __devinit iowa_register_bus(struct pci_controller *phb,
|
||||
struct iowa_bus *bus;
|
||||
struct device_node *np = phb->dn;
|
||||
|
||||
io_workaround_init();
|
||||
|
||||
if (iowa_bus_count >= IOWA_MAX_BUS) {
|
||||
pr_err("IOWA:Too many pci bridges, "
|
||||
"workarounds disabled for %s\n", np->full_name);
|
||||
@@ -171,14 +185,3 @@ void __devinit iowa_register_bus(struct pci_controller *phb,
|
||||
pr_debug("IOWA:[%d]Add bus, %s.\n", iowa_bus_count-1, np->full_name);
|
||||
}
|
||||
|
||||
/* enable IO workaround */
|
||||
void __devinit io_workaround_init(void)
|
||||
{
|
||||
static int io_workaround_inited;
|
||||
|
||||
if (io_workaround_inited)
|
||||
return;
|
||||
ppc_pci_io = iowa_pci_io;
|
||||
ppc_md.ioremap = iowa_ioremap;
|
||||
io_workaround_inited = 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user