Skip to content

Commit 1568426

Browse files
committed
ACPI: EC: Make acpi_ec_ecdt_probe() more straightforward
Since acpi_ec_ecdt_probe() is called when boot_ec is not set, it doesn't neeed to take the other possibility into account. Accordingly, it only needs to set the handle field in the ec object to ACPI_ROOT_OBJECT, call acpi_ec_setup() and (if that is successful) set boot_ec to ec and boot_ec_is_ecdt to 'true'. Make it do so directly, without calling acpi_config_boot_ec(), and avoid some pointless checks in the latter. No intentional functional impact except for a changed message. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent a9c3076 commit 1568426

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

drivers/acpi/ec.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1907,14 +1907,22 @@ void __init acpi_ec_ecdt_probe(void)
19071907
ec->data_addr = ecdt_ptr->data.address;
19081908
}
19091909
ec->gpe = ecdt_ptr->gpe;
1910+
ec->handle = ACPI_ROOT_OBJECT;
19101911

19111912
/*
19121913
* At this point, the namespace is not initialized, so do not find
19131914
* the namespace objects, or handle the events.
19141915
*/
1915-
ret = acpi_config_boot_ec(ec, ACPI_ROOT_OBJECT, false, true);
1916-
if (ret)
1916+
ret = acpi_ec_setup(ec, false);
1917+
if (ret) {
19171918
acpi_ec_free(ec);
1919+
return;
1920+
}
1921+
1922+
boot_ec = ec;
1923+
boot_ec_is_ecdt = true;
1924+
1925+
pr_info("Boot ECDT EC used to handle transactions\n");
19181926
}
19191927

19201928
#ifdef CONFIG_PM_SLEEP

0 commit comments

Comments
 (0)