Skip to content

Commit 3d9b8dd

Browse files
committed
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 <[email protected]>
1 parent e3cfabc commit 3d9b8dd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/acpi/ec.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1611,7 +1611,8 @@ static int acpi_ec_add(struct acpi_device *device)
16111611
strcpy(acpi_device_name(device), ACPI_EC_DEVICE_NAME);
16121612
strcpy(acpi_device_class(device), ACPI_EC_CLASS);
16131613

1614-
if (!strcmp(acpi_device_hid(device), ACPI_ECDT_HID)) {
1614+
if ((boot_ec && boot_ec->handle == device->handle) ||
1615+
!strcmp(acpi_device_hid(device), ACPI_ECDT_HID)) {
16151616
/* Fast path: this device corresponds to the boot EC. */
16161617
ec = boot_ec;
16171618
} else {

0 commit comments

Comments
 (0)