Skip to content

Commit d2c62ae

Browse files
committed
ACPI: EC: Eliminate acpi_config_boot_ec()
Notice that acpi_ec_add() calls acpi_config_boot_ec() when it finds that the device object passed to it represents a "boot" EC, but in that case the ec pointer passed to acpi_config_boot_ec() is guaranteed to be equal to boot_ec and ec->handle is passed as the handle argument to it, so acpi_config_boot_ec() really only calls acpi_ec_setup() and prints a message. Avoid the pointless checks in acpi_config_boot_ec() by calling acpi_ec_setup() directly and print the message separately. With the above changes in place, there are no users of acpi_config_boot_ec(), so drop it. No intentional functional impact except for a changed message. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent c746b6b commit d2c62ae

File tree

1 file changed

+8
-46
lines changed

1 file changed

+8
-46
lines changed

drivers/acpi/ec.c

Lines changed: 8 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1541,49 +1541,6 @@ static int acpi_ec_setup(struct acpi_ec *ec, bool handle_events)
15411541
return ret;
15421542
}
15431543

1544-
static int acpi_config_boot_ec(struct acpi_ec *ec, acpi_handle handle,
1545-
bool handle_events, bool is_ecdt)
1546-
{
1547-
int ret;
1548-
1549-
/*
1550-
* Changing the ACPI handle results in a re-configuration of the
1551-
* boot EC. And if it happens after the namespace initialization,
1552-
* it causes _REG evaluations.
1553-
*/
1554-
if (boot_ec && boot_ec->handle != handle)
1555-
ec_remove_handlers(boot_ec);
1556-
1557-
/* Unset old boot EC */
1558-
if (boot_ec != ec)
1559-
acpi_ec_free(boot_ec);
1560-
1561-
/*
1562-
* ECDT device creation is split into acpi_ec_ecdt_probe() and
1563-
* acpi_ec_ecdt_start(). This function takes care of completing the
1564-
* ECDT parsing logic as the handle update should be performed
1565-
* between the installation/uninstallation of the handlers.
1566-
*/
1567-
if (ec->handle != handle)
1568-
ec->handle = handle;
1569-
1570-
ret = acpi_ec_setup(ec, handle_events);
1571-
if (ret)
1572-
return ret;
1573-
1574-
/* Set new boot EC */
1575-
if (!boot_ec) {
1576-
boot_ec = ec;
1577-
boot_ec_is_ecdt = is_ecdt;
1578-
}
1579-
1580-
acpi_handle_info(boot_ec->handle,
1581-
"Used as boot %s EC to handle transactions%s\n",
1582-
is_ecdt ? "ECDT" : "DSDT",
1583-
handle_events ? " and events" : "");
1584-
return ret;
1585-
}
1586-
15871544
static bool acpi_ec_ecdt_get_handle(acpi_handle *phandle)
15881545
{
15891546
struct acpi_table_ecdt *ecdt_ptr;
@@ -1651,12 +1608,17 @@ static int acpi_ec_add(struct acpi_device *device)
16511608
acpi_ec_free(ec);
16521609
ec = boot_ec;
16531610
}
1654-
ret = acpi_config_boot_ec(ec, ec->handle, true, is_ecdt);
1655-
} else
1656-
ret = acpi_ec_setup(ec, true);
1611+
}
1612+
1613+
ret = acpi_ec_setup(ec, true);
16571614
if (ret)
16581615
goto err_query;
16591616

1617+
if (ec == boot_ec)
1618+
acpi_handle_info(boot_ec->handle,
1619+
"Boot %s EC used to handle transactions and events\n",
1620+
is_ecdt ? "ECDT" : "DSDT");
1621+
16601622
device->driver_data = ec;
16611623

16621624
ret = !!request_region(ec->data_addr, 1, "EC data");

0 commit comments

Comments
 (0)