Patchwork [v2,3/5] ACPI: EC: Make acpi_ec_dsdt_probe() more straightforward

login
register
mail settings
Submitter Rafael J. Wysocki
Date Feb. 1, 2019, 9:59 a.m.
Message ID <1584296.eCrsGTMp5G@aspire.rjw.lan>
Download mbox | patch
Permalink /patch/715637/
State New
Headers show

Comments

Rafael J. Wysocki - Feb. 1, 2019, 9:59 a.m.
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Since acpi_ec_dsdt_probe() returns early if boot_ec is set, it is
always unset when that function calls acpi_config_boot_ec() (passing
ec->handle as the handle argument to it).  Thus it is not really
useful to call acpi_config_boot_ec() at that point.  It is sufficient to
call acpi_ec_setup() directly and (if that is successful) set boot_ec,
so make acpi_ec_dsdt_probe() do that and avoid some pointless checks
in acpi_config_boot_ec().

No intentional functional impact except for a changed message.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/acpi/ec.c |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

Patch

Index: linux-pm/drivers/acpi/ec.c
===================================================================
--- linux-pm.orig/drivers/acpi/ec.c
+++ linux-pm/drivers/acpi/ec.c
@@ -1768,9 +1768,16 @@  void __init acpi_ec_dsdt_probe(void)
 	 * At this point, the GPE is not fully initialized, so do not to
 	 * handle the events.
 	 */
-	ret = acpi_config_boot_ec(ec, ec->handle, false, false);
-	if (ret)
+	ret = acpi_ec_setup(ec, false);
+	if (ret) {
 		acpi_ec_free(ec);
+		return;
+	}
+
+	boot_ec = ec;
+
+	acpi_handle_info(ec->handle,
+			 "Boot DSDT EC used to handle transactions\n");
 }
 
 /*