]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
platform/chrome: cros_ec_lpc: do not try DMI match when ACPI device found
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 22 May 2018 23:08:41 +0000 (16:08 -0700)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 14 Jan 2019 09:28:55 +0000 (09:28 +0000)
BugLink: http://bugs.launchpad.net/bugs/1807469
commit b410b1226620b6c959f1e9c87529acd058e90caf upstream.

Older models of Chromebooks did not describe the LPC EC in their ACPI
tables; starting with Strago-based devices Google is using GOOG0004 device
to describe EC LPC.

DMI-based match is fragile and does not work reliably, especially when
using custom firmware. It is also not needed when we can locate the right
ACPI device, so let's stop bailing out when DMI does not match but the
right ACPI device is present.

Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Benson Leung <bleung@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/platform/chrome/cros_ec_lpc.c

index 47ace99389524ab91185aef6c6f9b21ec950f3f4..ae1ea328aeae6f33d7dfe9ac900b108b0fe2fc6d 100644 (file)
@@ -412,7 +412,13 @@ static int __init cros_ec_lpc_init(void)
        int ret;
        acpi_status status;
 
-       if (!dmi_check_system(cros_ec_lpc_dmi_table)) {
+       status = acpi_get_devices(ACPI_DRV_NAME, cros_ec_lpc_parse_device,
+                                 &cros_ec_lpc_acpi_device_found, NULL);
+       if (ACPI_FAILURE(status))
+               pr_warn(DRV_NAME ": Looking for %s failed\n", ACPI_DRV_NAME);
+
+       if (!cros_ec_lpc_acpi_device_found &&
+           !dmi_check_system(cros_ec_lpc_dmi_table)) {
                pr_err(DRV_NAME ": unsupported system.\n");
                return -ENODEV;
        }
@@ -427,11 +433,6 @@ static int __init cros_ec_lpc_init(void)
                return ret;
        }
 
-       status = acpi_get_devices(ACPI_DRV_NAME, cros_ec_lpc_parse_device,
-                                 &cros_ec_lpc_acpi_device_found, NULL);
-       if (ACPI_FAILURE(status))
-               pr_warn(DRV_NAME ": Looking for %s failed\n", ACPI_DRV_NAME);
-
        if (!cros_ec_lpc_acpi_device_found) {
                /* Register the device, and it'll get hooked up automatically */
                ret = platform_device_register(&cros_ec_lpc_device);