Skip to content

Commit

Permalink
hw/slw: use dt_new_check()
Browse files Browse the repository at this point in the history
On P9 systems the /ibm,opal/power-mgt/ node may be created by the HDAT
parser before reaching add_cpu_idle_state_properties(). This is fine,
but it needs to be handled.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
  • Loading branch information
oohal authored and stewartsmith committed Jan 15, 2017
1 parent 7c5c6ca commit fa4954c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions hw/slw.c
Expand Up @@ -648,11 +648,10 @@ void add_cpu_idle_state_properties(void)
u32 *residency_ns_buf;
u32 *flags_buf;


prlog(PR_DEBUG, "CPU idle state device tree init\n");

/* Create /ibm,opal/power-mgt */
power_mgt = dt_new(opal_node, "power-mgt");
/* Create /ibm,opal/power-mgt if it doesn't exist already */
power_mgt = dt_new_check(opal_node, "power-mgt");
if (!power_mgt) {
/**
* @fwts-label CreateDTPowerMgtNodeFail
Expand Down

0 comments on commit fa4954c

Please sign in to comment.