aboutsummaryrefslogtreecommitdiff
path: root/hw/occ.c
diff options
context:
space:
mode:
authorCyril Bur <cyril.bur@au1.ibm.com>2018-03-19 15:54:16 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2018-03-27 14:51:38 +1100
commit7598ed90a6706158cce34596a33ededbb47af393 (patch)
tree960e964be1dbad4d10ddafa1d41073dba4bd15a5 /hw/occ.c
parent3c3b809cb8ba8c440353a0f0849f8c37e5f1ca1d (diff)
downloadskiboot-7598ed90a6706158cce34596a33ededbb47af393.zip
skiboot-7598ed90a6706158cce34596a33ededbb47af393.tar.gz
skiboot-7598ed90a6706158cce34596a33ededbb47af393.tar.bz2
fast-reboot: occ: Only delete /ibm, opal/power-mgt nodes if they exist
Fixes: ac4272bf ("fast-reboot: occ: Delete OCC child nodes in /ibm, opal/power-mgt") Fixes: CID 263053 Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw/occ.c')
-rw-r--r--hw/occ.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/hw/occ.c b/hw/occ.c
index 23228fa..2677640 100644
--- a/hw/occ.c
+++ b/hw/occ.c
@@ -1696,12 +1696,14 @@ void occ_pstates_init(void)
};
power_mgt = dt_find_by_path(dt_root, "/ibm,opal/power-mgt");
- for (i = 0; i < ARRAY_SIZE(props); i++)
- dt_check_del_prop(power_mgt, props[i]);
+ if (power_mgt) {
+ for (i = 0; i < ARRAY_SIZE(props); i++)
+ dt_check_del_prop(power_mgt, props[i]);
- dt_for_each_child(power_mgt, child)
- if (!strncmp(child->name, "occ", 3))
- dt_free(child);
+ dt_for_each_child(power_mgt, child)
+ if (!strncmp(child->name, "occ", 3))
+ dt_free(child);
+ }
}
switch (proc_gen) {