Skip to content

Commit c823c17

Browse files
committed
ACPI: EC: Avoid printing confusing messages in acpi_ec_setup()
It doesn't really make sense to pass ec->handle of the ECDT EC to acpi_handle_info(), because it is set to ACPI_ROOT_OBJECT in acpi_ec_ecdt_probe(), so rework acpi_ec_setup() to avoid using acpi_handle_info() for printing messages. First, notice that the "Used as first EC" message is not really useful, because it is immediately followed by a more meaningful one from either acpi_ec_ecdt_probe() or acpi_ec_dsdt_probe() (the latter also includes the EC object path), so drop it altogether. Second, use pr_info() for printing the EC configuration information. While at it, make the code in question avoid printing invalid GPE or IRQ numbers and make it print the GPE/IRQ information only when the driver is ready to handle events. Fixes: 72c77b7 ("ACPI / EC: Cleanup first_ec/boot_ec code") Fixes: 406857f ("ACPI: EC: add support for hardware-reduced systems") Cc: 5.5+ <[email protected]> # 5.5+ Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent f8788d8 commit c823c17

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

drivers/acpi/ec.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1584,14 +1584,19 @@ static int acpi_ec_setup(struct acpi_ec *ec, struct acpi_device *device,
15841584
return ret;
15851585

15861586
/* First EC capable of handling transactions */
1587-
if (!first_ec) {
1587+
if (!first_ec)
15881588
first_ec = ec;
1589-
acpi_handle_info(first_ec->handle, "Used as first EC\n");
1589+
1590+
pr_info("EC_CMD/EC_SC=0x%lx, EC_DATA=0x%lx\n", ec->command_addr,
1591+
ec->data_addr);
1592+
1593+
if (test_bit(EC_FLAGS_EVENT_HANDLER_INSTALLED, &ec->flags)) {
1594+
if (ec->gpe >= 0)
1595+
pr_info("GPE=0x%x\n", ec->gpe);
1596+
else
1597+
pr_info("IRQ=%d\n", ec->irq);
15901598
}
15911599

1592-
acpi_handle_info(ec->handle,
1593-
"GPE=0x%x, IRQ=%d, EC_CMD/EC_SC=0x%lx, EC_DATA=0x%lx\n",
1594-
ec->gpe, ec->irq, ec->command_addr, ec->data_addr);
15951600
return ret;
15961601
}
15971602

0 commit comments

Comments
 (0)