[PATCH] platform/wmi: Allow consumers to load without ACPI

Han Gao gaohan at iscas.ac.cn
Tue Nov 10 05:43:54 PST 2026


Since commit 4ea18e604272 ("ACPI: video: Remove CONFIG_X86 handling from
nvidia_wmi_ec_supported()"), the ACPI video module uses WMI on all
architectures. When ACPI is disabled, e.g. on a devicetree boot,
acpi_wmi_init() returns -ENODEV, so the wmi module fails to load and so
do video, amdgpu and radeon, which depend on it.

Return 0 without registering the WMI bus instead. The exported helpers
then report that no WMI device exists. Skip the teardown on module exit
accordingly.

Fixes: 4ea18e604272 ("ACPI: video: Remove CONFIG_X86 handling from nvidia_wmi_ec_supported()")
Signed-off-by: Han Gao <gaohan at iscas.ac.cn>
---
Tested on a HiFive Premier P550 booted with devicetree and an RX550,
with ACPI_WMI, ACPI_VIDEO and DRM_AMDGPU built as modules. Without
this patch, wmi fails to load and so do video and amdgpu. With it,
wmi, video and amdgpu load and the RX550 is initialized.
---
 drivers/platform/wmi/core.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/platform/wmi/core.c b/drivers/platform/wmi/core.c
index a99da9b7039d787ce3c1e0ece74ffbd79fafd3f7..6668789904a903c8d4e7810976f4e485d7a1b32a 100644
--- a/drivers/platform/wmi/core.c
+++ b/drivers/platform/wmi/core.c
@@ -1598,8 +1598,9 @@ static int __init acpi_wmi_init(void)
 {
 	int error;
 
+	/* ACPI video still needs the exported helpers when ACPI is disabled. */
 	if (acpi_disabled)
-		return -ENODEV;
+		return 0;
 
 	error = class_register(&wmi_bus_class);
 	if (error)
@@ -1628,6 +1629,9 @@ static int __init acpi_wmi_init(void)
 
 static void __exit acpi_wmi_exit(void)
 {
+	if (acpi_disabled)
+		return;
+
 	platform_driver_unregister(&acpi_wmi_driver);
 	bus_unregister(&wmi_bus_type);
 	class_unregister(&wmi_bus_class);

---
base-commit: 7475ea8b58616b33c04afb976cf0fbaad9dd63fb
change-id: 20261110-wmi-no-acpi-159a4cf19580

Best regards,
-- 
Han Gao <gaohan at iscas.ac.cn>




More information about the linux-riscv mailing list