aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLee, Chun-Yi <joeyli.kernel@gmail.com>2017-04-28 04:23:59 -0400
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>2017-04-28 14:51:29 -0400
commitf9ac89f5ad613b462339e845aeb8494646fd9be2 (patch)
tree6fe61187783cb203b60a0d6af643b4cbc392dbd8
parentccc7179f4d9467947c94f4302d61cd5143842fcd (diff)
platform/x86: acer-wmi: setup accelerometer when ACPI device was found
The 98d610c3739a patch was introduced since v4.11-rc1 that it causes that the accelerometer input device will not be created on workable machines because the HID string comparing logic is wrong. And, the patch doesn't prevent that the accelerometer input device be created on the machines that have no BST0001. That's because the acpi_get_devices() returns success even it didn't find any match device. This patch fixed the HID string comparing logic of BST0001 device. And, it also makes sure that the acpi_get_devices() returns acpi_handle for BST0001. Fixes: 98d610c3739a ("acer-wmi: setup accelerometer when machine has appropriate notify event") Reference: https://bugzilla.kernel.org/show_bug.cgi?id=193761 Reported-by: Samuel Sieb <samuel-kbugs@sieb.net> Signed-off-by: "Lee, Chun-Yi" <jlee@suse.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
-rw-r--r--drivers/platform/x86/acer-wmi.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
index 8a27f0be1aec..79fa5ab3fd00 100644
--- a/drivers/platform/x86/acer-wmi.c
+++ b/drivers/platform/x86/acer-wmi.c
@@ -1896,7 +1896,7 @@ static acpi_status __init acer_wmi_get_handle_cb(acpi_handle ah, u32 level,
1896 if (!strcmp(ctx, "SENR")) { 1896 if (!strcmp(ctx, "SENR")) {
1897 if (acpi_bus_get_device(ah, &dev)) 1897 if (acpi_bus_get_device(ah, &dev))
1898 return AE_OK; 1898 return AE_OK;
1899 if (!strcmp(ACER_WMID_ACCEL_HID, acpi_device_hid(dev))) 1899 if (strcmp(ACER_WMID_ACCEL_HID, acpi_device_hid(dev)))
1900 return AE_OK; 1900 return AE_OK;
1901 } else 1901 } else
1902 return AE_OK; 1902 return AE_OK;
@@ -1917,8 +1917,7 @@ static int __init acer_wmi_get_handle(const char *name, const char *prop,
1917 handle = NULL; 1917 handle = NULL;
1918 status = acpi_get_devices(prop, acer_wmi_get_handle_cb, 1918 status = acpi_get_devices(prop, acer_wmi_get_handle_cb,
1919 (void *)name, &handle); 1919 (void *)name, &handle);
1920 1920 if (ACPI_SUCCESS(status) && handle) {
1921 if (ACPI_SUCCESS(status)) {
1922 *ah = handle; 1921 *ah = handle;
1923 return 0; 1922 return 0;
1924 } else { 1923 } else {
@@ -2287,8 +2286,8 @@ static int __init acer_wmi_init(void)
2287 if (err) 2286 if (err)
2288 return err; 2287 return err;
2289 err = acer_wmi_accel_setup(); 2288 err = acer_wmi_accel_setup();
2290 if (err) 2289 if (err && err != -ENODEV)
2291 return err; 2290 pr_warn("Cannot enable accelerometer\n");
2292 } 2291 }
2293 2292
2294 err = platform_driver_register(&acer_platform_driver); 2293 err = platform_driver_register(&acer_platform_driver);