summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/pasemi
diff options
context:
space:
mode:
authorDarren Stevens <darren@stevens-zone.net>2018-07-25 21:55:18 +0100
committerMichael Ellerman <mpe@ellerman.id.au>2018-08-07 21:49:31 +1000
commit250a93501d6265bbb9ddf06af25ac9ae64782297 (patch)
tree51775b92f7c9b9ecfd9efe510bc27370da12ea4b /arch/powerpc/platforms/pasemi
parent396ab6ab284a9fff4154e9bd491372f43de8284c (diff)
downloadlinux-250a93501d6265bbb9ddf06af25ac9ae64782297.tar.gz
linux-250a93501d6265bbb9ddf06af25ac9ae64782297.tar.bz2
linux-250a93501d6265bbb9ddf06af25ac9ae64782297.zip
powerpc/pasemi: Search for PCI root bus by compatible property
Pasemi arch code finds the root of the PCI-e bus by searching the device-tree for a node called 'pxp'. But the root bus has a compatible property of 'pasemi,rootbus' so search for that instead. Signed-off-by: Darren Stevens <darren@stevens-zone.net> Acked-by: Olof Johansson <olof@lixom.net> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/platforms/pasemi')
-rw-r--r--arch/powerpc/platforms/pasemi/pci.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/arch/powerpc/platforms/pasemi/pci.c b/arch/powerpc/platforms/pasemi/pci.c
index aea9ff2c8e6d..3e3e807d5b6b 100644
--- a/arch/powerpc/platforms/pasemi/pci.c
+++ b/arch/powerpc/platforms/pasemi/pci.c
@@ -216,6 +216,7 @@ static int __init pas_add_bridge(struct device_node *dev)
void __init pas_pci_init(void)
{
struct device_node *np, *root;
+ int res;
root = of_find_node_by_path("/");
if (!root) {
@@ -226,11 +227,11 @@ void __init pas_pci_init(void)
pci_set_flags(PCI_SCAN_ALL_PCIE_DEVS);
- for (np = NULL; (np = of_get_next_child(root, np)) != NULL;)
- if (np->name && !strcmp(np->name, "pxp") && !pas_add_bridge(np))
- of_node_get(np);
-
- of_node_put(root);
+ np = of_find_compatible_node(root, NULL, "pasemi,rootbus");
+ if (np) {
+ res = pas_add_bridge(np);
+ of_node_put(np);
+ }
}
void __iomem *pasemi_pci_getcfgaddr(struct pci_dev *dev, int offset)