Skip to contentSkip to conversation

platform/x86: asus-wmi: Allow loading on systems without the Asus Management GUID

PATCH In review Hans de Goede 2 participants 2 messages Jan 21, 2019 – Jan 26, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 platform/x86: asus-wmi: Allow loading on systems without the Asus Management GUID

hid-asus depends on asus-wmi through the asus_wmi_evaluate_method. Before this commit asus-wmi and thus hid-asus could not be loaded on non Asus systems. This breaks using Asus bluetooth keyboards such as the Asus T100CHI keyboard with non Asus systems.

This commit fixes this by allowing asus-wmi to load on systems without the Asus Management GUID.

This is save to do since all asus-wmi sub drivers use asus_wmi_register_driver which also checks for the GUID.

This commit also improves the error messages in asus_wmi_register_driver to include "ASUS" in their description tom make them more clear. This is important since we now rely on those errors when loaded on systems without the Asus Management GUID.

---
 drivers/platform/x86/asus-wmi.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/platform/x86/asus-wmi.c +2 -7
index 37b5de541270..ee1fa93708ec 100644
@@ -2265,12 +2265,12 @@ static int asus_wmi_probe(struct platform_device *pdev)
 	int ret;
 
 	if (!wmi_has_guid(ASUS_WMI_MGMT_GUID)) {
-		pr_warn("Management GUID not found\n");
+		pr_warn("ASUS Management GUID not found\n");
 		return -ENODEV;
 	}
 
 	if (wdrv->event_guid && !wmi_has_guid(wdrv->event_guid)) {
-		pr_warn("Event GUID not found\n");
+		pr_warn("ASUS Event GUID not found\n");
 		return -ENODEV;
 	}
 
@@ -2320,11 +2320,6 @@ EXPORT_SYMBOL_GPL(asus_wmi_unregister_driver);
 
 static int __init asus_wmi_init(void)
 {
-	if (!wmi_has_guid(ASUS_WMI_MGMT_GUID)) {
-		pr_info("Asus Management GUID not found\n");
-		return -ENODEV;
-	}
-
 	pr_info("ASUS WMI generic driver loaded\n");
 	return 0;
 }
Signature · 1 line
2.20.1
#1 lore raw
Quoted 11 lines · Hans de Goede

hid-asus depends on asus-wmi through the asus_wmi_evaluate_method. Before this commit asus-wmi and thus hid-asus could not be loaded on non Asus systems. This breaks using Asus bluetooth keyboards such as the Asus T100CHI keyboard with non Asus systems.

This commit fixes this by allowing asus-wmi to load on systems without the Asus Management GUID.

This is save to do since all asus-wmi sub drivers use asus_wmi_register_driver which also checks for the GUID.

Quoted 6 lines

This commit also improves the error messages in asus_wmi_register_driver to include "ASUS" in their description tom make them more clear. This is important since we now rely on those errors when loaded on systems without the Asus Management GUID.

Hi Hans,

A few typos above, please consider adding a spellchecker to your editor for commit message authoring... I've taken care of them and queued this patch for testing.

Thanks!

Signature · 2 lines
Darren Hart
VMware Open Source Technology Center