diff options
Diffstat (limited to 'drivers/acpi/bus.c')
-rw-r--r-- | drivers/acpi/bus.c | 41 |
1 files changed, 29 insertions, 12 deletions
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 99d820a693a8..6ecbbabf1233 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -799,10 +799,24 @@ const struct acpi_device_id *acpi_match_device(const struct acpi_device_id *ids, } EXPORT_SYMBOL_GPL(acpi_match_device); +static const void *acpi_of_device_get_match_data(const struct device *dev) +{ + struct acpi_device *adev = ACPI_COMPANION(dev); + const struct of_device_id *match = NULL; + + if (!acpi_of_match_device(adev, dev->driver->of_match_table, &match)) + return NULL; + + return match->data; +} + const void *acpi_device_get_match_data(const struct device *dev) { const struct acpi_device_id *match; + if (!dev->driver->acpi_match_table) + return acpi_of_device_get_match_data(dev); + match = acpi_match_device(dev->driver->acpi_match_table, dev); if (!match) return NULL; @@ -1029,6 +1043,9 @@ void __init acpi_early_init(void) acpi_permanent_mmap = true; + /* Initialize debug output. Linux does not use ACPICA defaults */ + acpi_dbg_level = ACPI_LV_INFO | ACPI_LV_REPAIR; + #ifdef CONFIG_X86 /* * If the machine falls into the DMI check table, @@ -1054,18 +1071,6 @@ void __init acpi_early_init(void) goto error0; } - /* - * ACPI 2.0 requires the EC driver to be loaded and work before - * the EC device is found in the namespace (i.e. before - * acpi_load_tables() is called). - * - * This is accomplished by looking for the ECDT table, and getting - * the EC parameters out of that. - * - * Ignore the result. Not having an ECDT is not fatal. - */ - status = acpi_ec_ecdt_probe(); - #ifdef CONFIG_X86 if (!acpi_ioapic) { /* compatible (0) means level (3) */ @@ -1142,6 +1147,18 @@ static int __init acpi_bus_init(void) goto error1; } + /* + * ACPI 2.0 requires the EC driver to be loaded and work before the EC + * device is found in the namespace. + * + * This is accomplished by looking for the ECDT table and getting the EC + * parameters out of that. + * + * Do that before calling acpi_initialize_objects() which may trigger EC + * address space accesses. + */ + acpi_ec_ecdt_probe(); + status = acpi_enable_subsystem(ACPI_NO_ACPI_ENABLE); if (ACPI_FAILURE(status)) { printk(KERN_ERR PREFIX |