[v3,2/6] Drivers: hv: allow non ACPI compilation for hv_is_hibernation_supported

Message ID 1675706060-22361-3-git-send-email-ssengar@linux.microsoft.com
State New
Headers
Series Device tree support for Hyper-V VMBus driver |

Commit Message

Saurabh Singh Sengar Feb. 6, 2023, 5:54 p.m. UTC
  acpi_sleep_state_supported API is only define for CONFIG_ACPI flag and
thus it can't be used for non-ACPI builds. Initially there won't be
hibernation support for non ACPI builds.

This change will help adding device tree support in subsequent commits.

Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com>
---
[V3]
- Typos fix: s/Initaly/Initially/ and s/hibernate/hibernation/.

 drivers/hv/hv_common.c | 4 ++++
 1 file changed, 4 insertions(+)
  

Patch

diff --git a/drivers/hv/hv_common.c b/drivers/hv/hv_common.c
index 52a6f89ccdbd..370ec20d1993 100644
--- a/drivers/hv/hv_common.c
+++ b/drivers/hv/hv_common.c
@@ -234,7 +234,11 @@  EXPORT_SYMBOL_GPL(hv_setup_dma_ops);
 
 bool hv_is_hibernation_supported(void)
 {
+#ifdef CONFIG_ACPI
 	return !hv_root_partition && acpi_sleep_state_supported(ACPI_STATE_S4);
+#else
+	return false;
+#endif
 }
 EXPORT_SYMBOL_GPL(hv_is_hibernation_supported);