summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/ec.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2020-03-02 11:25:21 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2020-03-02 11:25:21 +0100
commit3d9b8dd8320de69945ea7ccd0d1a76464138ba37 (patch)
treebf0c5601af1f42bda1ee8cfc4741c0c86ee6e98e /drivers/acpi/ec.c
parente3cfabcd736a00c61c3a5ee322186b30c642993a (diff)
downloadlinux-3d9b8dd8320de69945ea7ccd0d1a76464138ba37.tar.bz2
ACPI: EC: Use fast path in acpi_ec_add() for DSDT boot EC
If the boot EC comes from the DSDT, its ACPI handle is equal to the handle of a device object with the PNP0C09 device ID. If that device object is passed to acpi_ec_add(), it is not necessary to allocate a new EC structure for it and parse it, because that has been done already, so change the function to use the fast path in that case. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/ec.c')
-rw-r--r--drivers/acpi/ec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 116163add41b..355d6973cb70 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -1611,7 +1611,8 @@ static int acpi_ec_add(struct acpi_device *device)
strcpy(acpi_device_name(device), ACPI_EC_DEVICE_NAME);
strcpy(acpi_device_class(device), ACPI_EC_CLASS);
- if (!strcmp(acpi_device_hid(device), ACPI_ECDT_HID)) {
+ if ((boot_ec && boot_ec->handle == device->handle) ||
+ !strcmp(acpi_device_hid(device), ACPI_ECDT_HID)) {
/* Fast path: this device corresponds to the boot EC. */
ec = boot_ec;
} else {