linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Linux ACPI <linux-acpi@vger.kernel.org>
Cc: Erik Schmauss <erik.schmauss@intel.com>,
	Zhang Rui <rui.zhang@intel.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH v2 2/5] ACPI: EC: Make acpi_ec_ecdt_probe() more straightforward
Date: Fri, 01 Feb 2019 10:58:20 +0100	[thread overview]
Message-ID: <8113695.UgGZYynV14@aspire.rjw.lan> (raw)
In-Reply-To: <2804781.zocuRj5ZkX@aspire.rjw.lan>

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

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>
---
 drivers/acpi/ec.c |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

Index: linux-pm/drivers/acpi/ec.c
===================================================================
--- linux-pm.orig/drivers/acpi/ec.c
+++ linux-pm/drivers/acpi/ec.c
@@ -1907,14 +1907,22 @@ void __init acpi_ec_ecdt_probe(void)
 		ec->data_addr = ecdt_ptr->data.address;
 	}
 	ec->gpe = ecdt_ptr->gpe;
+	ec->handle = ACPI_ROOT_OBJECT;
 
 	/*
 	 * At this point, the namespace is not initialized, so do not find
 	 * the namespace objects, or handle the events.
 	 */
-	ret = acpi_config_boot_ec(ec, ACPI_ROOT_OBJECT, false, true);
-	if (ret)
+	ret = acpi_ec_setup(ec, false);
+	if (ret) {
 		acpi_ec_free(ec);
+		return;
+	}
+
+	boot_ec = ec;
+	boot_ec_is_ecdt = true;
+
+	pr_info("Boot ECDT EC used to handle transactions\n");
 }
 
 #ifdef CONFIG_PM_SLEEP


  parent reply	other threads:[~2019-02-01 10:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-22 11:55 [PATCH 0/2] ACPI: EC: Simplify boot EC setup Rafael J. Wysocki
2019-01-22 11:56 ` [PATCH 1/2] ACPI: EC: Untangle " Rafael J. Wysocki
2019-01-22 11:57 ` [PATCH 1/2] ACPI: EC: Simplify boot EC checks in acpi_ec_add() Rafael J. Wysocki
2019-01-22 12:03   ` Rafael J. Wysocki
2019-02-01  9:56 ` [PATCH v2 0/5] ACPI: EC: Simplify boot EC setup Rafael J. Wysocki
2019-02-01  9:57   ` [PATCH v2 1/5] ACPI: EC: Declare boot_ec as static Rafael J. Wysocki
2019-02-01  9:58   ` Rafael J. Wysocki [this message]
2019-02-01  9:59   ` [PATCH v2 3/5] ACPI: EC: Make acpi_ec_dsdt_probe() more straightforward Rafael J. Wysocki
2019-02-01 10:01   ` [PATCH v2 4/5] ACPI: EC: Eliminate acpi_config_boot_ec() Rafael J. Wysocki
2019-02-01 11:47     ` [PATCH v3 " Rafael J. Wysocki
2019-02-01 10:03   ` [PATCH v2 5/5] ACPI: EC: Simplify boot EC checks in acpi_ec_add() Rafael J. Wysocki
2019-02-01 11:50     ` [PATCH v3 " Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8113695.UgGZYynV14@aspire.rjw.lan \
    --to=rjw@rjwysocki.net \
    --cc=erik.schmauss@intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rui.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).