lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250523131451.1942578-2-luke@ljones.dev>
Date: Fri, 23 May 2025 15:14:51 +0200
From: Luke Jones <luke@...nes.dev>
To: linux-kernel@...r.kernel.org
Cc: hdegoede@...hat.com,
	ilpo.jarvinen@...ux.intel.com,
	platform-driver-x86@...r.kernel.org,
	mario.limonciello@....com,
	andriy.shevchenko@...ux.intel.com,
	Luke Jones <luke@...nes.dev>,
	kernel test robot <lkp@...el.com>
Subject: [PATCH 1/1] platform/x86: asus-wmi: fix build without CONFIG_SUSPEND

The patch "Refactor Ally suspend/resume" introduced an
acpi_s2idle_dev_ops for use with ROG Ally which caused a build error
if CONFIG_SUSPEND was not defined.

Signed-off-by: Luke Jones <luke@...nes.dev>
Reported-by: kernel test robot <lkp@...el.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202505090418.DaeaXe4i-lkp@intel.com/
Fixes: feea7bd6b02d ("platform/x86: asus-wmi: Refactor Ally suspend/resume")
---
 drivers/platform/x86/asus-wmi.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index 27f11643a00d..087318e0d595 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -5005,6 +5005,7 @@ static int asus_hotk_restore(struct device *device)
 	return 0;
 }
 
+#if defined(CONFIG_SUSPEND)
 static void asus_ally_s2idle_restore(void)
 {
 	if (use_ally_mcu_hack == ASUS_WMI_ALLY_MCU_HACK_ENABLED) {
@@ -5013,6 +5014,7 @@ static void asus_ally_s2idle_restore(void)
 		msleep(ASUS_USB0_PWR_EC0_CSEE_WAIT);
 	}
 }
+#endif /* CONFIG_SUSPEND */
 
 static int asus_hotk_prepare(struct device *device)
 {
@@ -5025,9 +5027,11 @@ static int asus_hotk_prepare(struct device *device)
 }
 
 /* Use only for Ally devices due to the wake_on_ac */
+#if defined(CONFIG_SUSPEND)
 static struct acpi_s2idle_dev_ops asus_ally_s2idle_dev_ops = {
 	.restore = asus_ally_s2idle_restore,
 };
+#endif /* CONFIG_SUSPEND */
 
 static const struct dev_pm_ops asus_pm_ops = {
 	.thaw = asus_hotk_thaw,
@@ -5060,9 +5064,11 @@ static int asus_wmi_probe(struct platform_device *pdev)
 			return ret;
 	}
 
+	#if defined(CONFIG_SUSPEND)
 	ret = acpi_register_lps0_dev(&asus_ally_s2idle_dev_ops);
 	if (ret)
 		pr_warn("failed to register LPS0 sleep handler in asus-wmi\n");
+	#endif /* CONFIG_SUSPEND */
 
 	return asus_wmi_add(pdev);
 }
@@ -5096,7 +5102,10 @@ EXPORT_SYMBOL_GPL(asus_wmi_register_driver);
 
 void asus_wmi_unregister_driver(struct asus_wmi_driver *driver)
 {
+	#if defined(CONFIG_SUSPEND)
 	acpi_unregister_lps0_dev(&asus_ally_s2idle_dev_ops);
+	#endif /* CONFIG_SUSPEND */
+
 	platform_device_unregister(driver->platform_device);
 	platform_driver_unregister(&driver->platform_driver);
 	used = false;
-- 
2.49.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ