ACPI: bus: Add stub acpi_sleep_state_supported() in non-ACPI cases
authorSaurabh Sengar <ssengar@linux.microsoft.com>
Mon, 20 Mar 2023 07:47:37 +0000 (00:47 -0700)
committerWei Liu <wei.liu@kernel.org>
Mon, 17 Apr 2023 19:16:22 +0000 (19:16 +0000)
acpi_sleep_state_supported() is defined only when CONFIG_ACPI=y. The
function is in acpi_bus.h, and acpi_bus.h can only be used in
CONFIG_ACPI=y cases. Add the stub function to linux/acpi.h to make
compilation successful for !CONFIG_ACPI cases.

Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://lore.kernel.org/r/1679298460-11855-3-git-send-email-ssengar@linux.microsoft.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
include/linux/acpi.h

index efff750f326d6532844c06e9dc32e925f5deb3bf..d331f76b0c19fbf7ecde9bfcb5c829abea751e79 100644 (file)
@@ -1075,6 +1075,11 @@ static inline u32 acpi_osc_ctx_get_cxl_control(struct acpi_osc_context *context)
        return 0;
 }
 
+static inline bool acpi_sleep_state_supported(u8 sleep_state)
+{
+       return false;
+}
+
 #endif /* !CONFIG_ACPI */
 
 #ifdef CONFIG_ACPI_HOTPLUG_IOAPIC