[PATCH -next] thermal: intel_pch_thermal: fix build for ACPI not enabled

From: Randy Dunlap
Date: Mon Nov 16 2020 - 21:38:43 EST


The reference to acpi_gbl_FADT causes a build error when ACPI is not
enabled. Fix by making that conditional on CONFIG_ACPI.

../drivers/thermal/intel/intel_pch_thermal.c: In function 'pch_wpt_suspend':
../drivers/thermal/intel/intel_pch_thermal.c:217:8: error: 'acpi_gbl_FADT' undeclared (first use in this function); did you mean 'acpi_get_type'?
if (!(acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0))
^~~~~~~~~~~~~

Fixes: ef63b043ac86 ("thermal: intel: pch: fix S0ix failure due to PCH temperature above threshold")
Signed-off-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
Cc: Sumeet Pawnikar <sumeet.r.pawnikar@xxxxxxxxx>
Cc: Daniel Lezcano <daniel.lezcano@xxxxxxxxxx>
Cc: Zhang Rui <rui.zhang@xxxxxxxxx>
Cc: Amit Kucheria <amitk@xxxxxxxxxx>
Cc: linux-pm@xxxxxxxxxxxxxxx
---
drivers/thermal/intel/intel_pch_thermal.c | 4 ++++
1 file changed, 4 insertions(+)

--- linux-next-20201116.orig/drivers/thermal/intel/intel_pch_thermal.c
+++ linux-next-20201116/drivers/thermal/intel/intel_pch_thermal.c
@@ -214,8 +214,12 @@ static int pch_wpt_suspend(struct pch_th
}

/* Do not check temperature if it is not a S0ix capable platform */
+#ifdef CONFIG_ACPI
if (!(acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0))
return 0;
+#else
+ return 0;
+#endif

/* Do not check temperature if it is not s2idle */
if (pm_suspend_via_firmware())