ELOG: Introduce elog_gsmi variants

This avoids a lot of if (CONFIG(ELOG_GSMI)) boilerplate.

Change-Id: I87d25c820daedeb33b3b474a6632a89ea80b0867
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36647
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/src/southbridge/intel/lynxpoint/smihandler.c b/src/southbridge/intel/lynxpoint/smihandler.c
index de2866e..61f86fb 100644
--- a/src/southbridge/intel/lynxpoint/smihandler.c
+++ b/src/southbridge/intel/lynxpoint/smihandler.c
@@ -140,11 +140,9 @@
 #endif
 	usb_xhci_sleep_prepare(PCH_XHCI_DEV, slp_typ);
 
-#if CONFIG(ELOG_GSMI)
 	/* Log S3, S4, and S5 entry */
 	if (slp_typ >= ACPI_S3)
-		elog_add_event_byte(ELOG_TYPE_ACPI_ENTER, slp_typ);
-#endif
+		elog_gsmi_add_event_byte(ELOG_TYPE_ACPI_ENTER, slp_typ);
 
 	/* Next, do the deed.
 	 */
@@ -247,7 +245,6 @@
 	return NULL;
 }
 
-#if CONFIG(ELOG_GSMI)
 static void southbridge_smi_gsmi(void)
 {
 	u32 *ret, *param;
@@ -268,7 +265,6 @@
 	/* drivers/elog/gsmi.c */
 	*ret = gsmi_exec(sub_command, param);
 }
-#endif
 
 static void southbridge_smi_apmc(void)
 {
@@ -332,11 +328,10 @@
 	case 0xca:
 		usb_xhci_route_all();
 		break;
-#if CONFIG(ELOG_GSMI)
 	case APM_CNT_ELOG_GSMI:
-		southbridge_smi_gsmi();
+		if (CONFIG(ELOG_GSMI))
+			southbridge_smi_gsmi();
 		break;
-#endif
 	}
 
 	mainboard_smi_apmc(reg8);
@@ -351,9 +346,7 @@
 	 */
 	if (pm1_sts & PWRBTN_STS) {
 		// power button pressed
-#if CONFIG(ELOG_GSMI)
-		elog_add_event(ELOG_TYPE_POWER_BUTTON);
-#endif
+		elog_gsmi_add_event(ELOG_TYPE_POWER_BUTTON);
 		disable_pm1_control(-1UL);
 		enable_pm1_control(SLP_EN | (SLP_TYP_S5 << 10));
 	}