ipmi-sel: use opal_booting() over poking at debug descriptor

Message ID 20180608044617.30334-1-stewart@linux.ibm.com
State Accepted
Headers show
Series
  • ipmi-sel: use opal_booting() over poking at debug descriptor
Related show

Commit Message

Stewart Smith June 8, 2018, 4:46 a.m.
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
---
 hw/ipmi/ipmi-sel.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Stewart Smith June 19, 2018, 5:43 a.m. | #1
Stewart Smith <stewart@linux.ibm.com> writes:
> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
> ---
>  hw/ipmi/ipmi-sel.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)

Merged to master as of 1839d2c714f825689ee61b66adb41726e2d14099

Patch

diff --git a/hw/ipmi/ipmi-sel.c b/hw/ipmi/ipmi-sel.c
index 338685414153..466fcb2608d8 100644
--- a/hw/ipmi/ipmi-sel.c
+++ b/hw/ipmi/ipmi-sel.c
@@ -504,8 +504,7 @@  static void sel_power(uint8_t power)
 	switch (power) {
 	case SOFT_OFF:
 		prlog(PR_NOTICE, "Soft shutdown requested\n");
-		if (!(debug_descriptor.state_flags & OPAL_BOOT_COMPLETE) &&
-		    platform.cec_power_down) {
+		if (opal_booting() && platform.cec_power_down) {
 			prlog(PR_NOTICE, "Host not up, shutting down now\n");
 			platform.cec_power_down(IPMI_CHASSIS_PWR_DOWN);
 		} else {
@@ -515,8 +514,7 @@  static void sel_power(uint8_t power)
 		break;
 	case SOFT_REBOOT:
 		prlog(PR_NOTICE, "Soft reboot requested\n");
-		if (!(debug_descriptor.state_flags & OPAL_BOOT_COMPLETE) &&
-		    platform.cec_reboot) {
+		if (opal_booting() && platform.cec_reboot) {
 			prlog(PR_NOTICE, "Host not up, rebooting now\n");
 			platform.cec_reboot();
 		} else {