aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/kernel/eeh_pe.c33
1 files changed, 15 insertions, 18 deletions
diff --git a/arch/powerpc/kernel/eeh_pe.c b/arch/powerpc/kernel/eeh_pe.c
index 8654cb166c19..ca9e5371930e 100644
--- a/arch/powerpc/kernel/eeh_pe.c
+++ b/arch/powerpc/kernel/eeh_pe.c
@@ -883,32 +883,29 @@ void eeh_pe_restore_bars(struct eeh_pe *pe)
883const char *eeh_pe_loc_get(struct eeh_pe *pe) 883const char *eeh_pe_loc_get(struct eeh_pe *pe)
884{ 884{
885 struct pci_bus *bus = eeh_pe_bus_get(pe); 885 struct pci_bus *bus = eeh_pe_bus_get(pe);
886 struct device_node *dn = pci_bus_to_OF_node(bus); 886 struct device_node *dn;
887 const char *loc = NULL; 887 const char *loc = NULL;
888 888
889 if (!dn) 889 while (bus) {
890 goto out; 890 dn = pci_bus_to_OF_node(bus);
891 if (!dn) {
892 bus = bus->parent;
893 continue;
894 }
891 895
892 /* PHB PE or root PE ? */ 896 if (pci_is_root_bus(bus))
893 if (pci_is_root_bus(bus)) {
894 loc = of_get_property(dn, "ibm,loc-code", NULL);
895 if (!loc)
896 loc = of_get_property(dn, "ibm,io-base-loc-code", NULL); 897 loc = of_get_property(dn, "ibm,io-base-loc-code", NULL);
898 else
899 loc = of_get_property(dn, "ibm,slot-location-code",
900 NULL);
901
897 if (loc) 902 if (loc)
898 goto out; 903 return loc;
899 904
900 /* Check the root port */ 905 bus = bus->parent;
901 dn = dn->child;
902 if (!dn)
903 goto out;
904 } 906 }
905 907
906 loc = of_get_property(dn, "ibm,loc-code", NULL); 908 return "N/A";
907 if (!loc)
908 loc = of_get_property(dn, "ibm,slot-location-code", NULL);
909
910out:
911 return loc ? loc : "N/A";
912} 909}
913 910
914/** 911/**