[Skiboot] [PATCH 02/16] platforms/astbmc: ibm, slot-label not depend on ibm, slot-location-code
Gavin Shan
gwshan at linux.vnet.ibm.com
Fri Sep 16 15:05:09 AEST 2016
"ibm,slot-label" should not depend on "ibm,slot-location-code". We
might fail to populate the later one because of oversized "ibm,slot-label"
or PHB's base location code.
This populates "ibm,slot-label" unconditionally. It won't depend on
"ibm,slot-location-code".
Signed-off-by: Gavin Shan <gwshan at linux.vnet.ibm.com>
---
platforms/astbmc/slots.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/platforms/astbmc/slots.c b/platforms/astbmc/slots.c
index 6ffec7d..e71eb38 100644
--- a/platforms/astbmc/slots.c
+++ b/platforms/astbmc/slots.c
@@ -95,6 +95,8 @@ static void add_slot_properties(struct pci_slot *slot,
if (!np || !ent)
return;
+ dt_add_property_string(np, "ibm,slot-label", ent->name);
+
base_loc_code_len = phb->base_loc_code ? strlen(phb->base_loc_code) : 0;
slot_label_len = strlen(ent->name);
if ((base_loc_code_len + slot_label_len + 1) >= LOC_CODE_SIZE)
@@ -111,7 +113,6 @@ static void add_slot_properties(struct pci_slot *slot,
strcat(loc_code, ent->name);
dt_add_property(np, "ibm,slot-location-code",
loc_code, strlen(loc_code) + 1);
- dt_add_property_string(np, "ibm,slot-label", ent->name);
}
void slot_table_get_slot_info(struct phb *phb, struct pci_device *pd)
--
2.1.0
More information about the Skiboot
mailing list