aboutsummaryrefslogtreecommitdiff
path: root/platforms
diff options
context:
space:
mode:
authorNeelesh Gupta <neelegup@linux.vnet.ibm.com>2015-01-20 10:01:28 +0530
committerStewart Smith <stewart@linux.vnet.ibm.com>2015-01-22 14:52:23 +1100
commitf01254e7034a974d48ffb3085dc1b07b8767e954 (patch)
tree0b6d5901b42eb31c561d905d0774d964cbea9666 /platforms
parent7e8dc30b32bf5083aa5bda56b10601d42f1921b3 (diff)
downloadskiboot-f01254e7034a974d48ffb3085dc1b07b8767e954.zip
skiboot-f01254e7034a974d48ffb3085dc1b07b8767e954.tar.gz
skiboot-f01254e7034a974d48ffb3085dc1b07b8767e954.tar.bz2
PLAT: Use NULL check instead assertion
There could be some processor chips not populated in the system. So, if we are not able to get chip data of given chip id, we should just move on to the next or return instead of aborting (bz 120562). Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'platforms')
-rw-r--r--platforms/ibm-fsp/firenze.c42
1 files changed, 25 insertions, 17 deletions
diff --git a/platforms/ibm-fsp/firenze.c b/platforms/ibm-fsp/firenze.c
index d971d57..258a6b3 100644
--- a/platforms/ibm-fsp/firenze.c
+++ b/platforms/ibm-fsp/firenze.c
@@ -130,29 +130,37 @@ static void firenze_dt_fixup_i2cm(void)
case LX_VPD_SHARK_BACKPLANE: /* XXX confirm ? */
/* i2c nodes on chip 0x10 */
c = get_chip(0x10);
- assert(c);
-
- /* Engine 1 */
- master = dt_create_i2c_master(c->devnode, 1);
- assert(master);
- snprintf(name, sizeof(name), "p8_%08x_e%dp%d", c->id, 1, 0);
- bus = dt_create_i2c_bus(master, name, 0);
- assert(bus);
- dev = dt_create_i2c_device(bus, 0x39, "power-control",
- "maxim,5961", "pcie-hotplug");
- assert(dev);
- dt_add_property_strings(dev, "target-list", "slot-C4", "slot-C5");
+ if (c) {
+ /* Engine 1 */
+ master = dt_create_i2c_master(c->devnode, 1);
+ assert(master);
+ snprintf(name, sizeof(name), "p8_%08x_e%dp%d", c->id, 1, 0);
+ bus = dt_create_i2c_bus(master, name, 0);
+ assert(bus);
+ dev = dt_create_i2c_device(bus, 0x39, "power-control",
+ "maxim,5961", "pcie-hotplug");
+ assert(dev);
+ dt_add_property_strings(dev, "target-list", "slot-C4",
+ "slot-C5");
+
+ dev = dt_create_i2c_device(bus, 0x3a, "power-control",
+ "maxim,5961", "pcie-hotplug");
+ assert(dev);
+ dt_add_property_strings(dev, "target-list", "slot-C2",
+ "slot-C3");
+ } else {
+ prlog(PR_INFO, "PLAT: Chip not found for the id 0x10\n");
+ }
- dev = dt_create_i2c_device(bus, 0x3a, "power-control",
- "maxim,5961", "pcie-hotplug");
- assert(dev);
- dt_add_property_strings(dev, "target-list", "slot-C2", "slot-C3");
/* Fall through */
case LX_VPD_1S4U_BACKPLANE:
case LX_VPD_1S2U_BACKPLANE:
/* i2c nodes on chip 0 */
c = get_chip(0);
- assert(c);
+ if (!c) {
+ prlog(PR_INFO, "PLAT: Chip not found for the id 0x0\n");
+ break;
+ }
/* Engine 1*/
master = dt_create_i2c_master(c->devnode, 1);