@@ -125,7 +125,7 @@ struct machdep_calls {
/* Called after allocating resources */
void (*pcibios_fixup)(void);
void (*pci_irq_fixup)(struct pci_dev *dev);
- int (*pcibios_root_bridge_prepare)(struct pci_host_bridge
+ int (*pcibios_root_bus_prepare)(struct pci_host_bridge
*bridge);
/* To setup PHBs when using automatic OF platform driver for PCI */
@@ -781,10 +781,10 @@ int pci_proc_domain(struct pci_bus *bus)
return 1;
}
-int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge)
+int pcibios_root_bus_prepare(struct pci_host_bridge *bridge)
{
- if (ppc_md.pcibios_root_bridge_prepare)
- return ppc_md.pcibios_root_bridge_prepare(bridge);
+ if (ppc_md.pcibios_root_bus_prepare)
+ return ppc_md.pcibios_root_bus_prepare(bridge);
return 0;
}
@@ -110,7 +110,7 @@ static void fixup_winbond_82c105(struct pci_dev* dev)
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105,
fixup_winbond_82c105);
-int pseries_root_bridge_prepare(struct pci_host_bridge *bridge)
+int pseries_root_bus_prepare(struct pci_host_bridge *bridge)
{
struct device_node *dn, *pdn;
struct pci_bus *bus;
@@ -75,7 +75,7 @@ static inline int dlpar_memory(struct pseries_hp_errorlog *hp_elog)
/* PCI root bridge prepare function override for pseries */
struct pci_host_bridge;
-int pseries_root_bridge_prepare(struct pci_host_bridge *bridge);
+int pseries_root_bus_prepare(struct pci_host_bridge *bridge);
extern struct pci_controller_ops pseries_pci_controller_ops;
@@ -537,7 +537,7 @@ static void __init pSeries_setup_arch(void)
ppc_md.enable_pmcs = power4_enable_pmcs;
}
- ppc_md.pcibios_root_bridge_prepare = pseries_root_bridge_prepare;
+ ppc_md.pcibios_root_bus_prepare = pseries_root_bus_prepare;
if (firmware_has_feature(FW_FEATURE_SET_MODE)) {
long rc;
@@ -1883,6 +1883,11 @@ int __weak pcibios_root_bridge_prepare(struct pci_host_bridge *bridge)
return 0;
}
+int __weak pcibios_root_bus_prepare(struct pci_host_bridge *bridge)
+{
+ return 0;
+}
+
void __weak pcibios_add_bus(struct pci_bus *bus)
{
}
@@ -1948,6 +1953,10 @@ struct pci_bus *pci_create_root_bus(struct device *parent, int domain,
b->dev.class = &pcibus_class;
b->dev.parent = b->bridge;
dev_set_name(&b->dev, "%04x:%02x", pci_domain_nr(b), bus);
+ error = pcibios_root_bus_prepare(bridge);
+ if (error)
+ goto class_dev_reg_err;
+
error = device_register(&b->dev);
if (error)
goto class_dev_reg_err;
Pcibios_root_bridge_prepare() in powerpc set root bus speed, it's not the preparation for pci host bridge. For better separation of host bridge and root bus creation, It's need to rename it to another weak function. Signed-off-by: Yijing Wang <wangyijing@huawei.com> --- arch/powerpc/include/asm/machdep.h | 2 +- arch/powerpc/kernel/pci-common.c | 6 +++--- arch/powerpc/platforms/pseries/pci.c | 2 +- arch/powerpc/platforms/pseries/pseries.h | 2 +- arch/powerpc/platforms/pseries/setup.c | 2 +- drivers/pci/probe.c | 9 +++++++++ 6 files changed, 16 insertions(+), 7 deletions(-)