From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Linux ACPI <linux-acpi@vger.kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Hans de Goede <hdegoede@redhat.com>,
Mika Westerberg <mika.westerberg@linux.intel.com>
Subject: [PATCH] ACPI: glue: Use acpi_device_adr() in acpi_find_child_device()
Date: Wed, 27 Oct 2021 18:59:06 +0200 [thread overview]
Message-ID: <11862679.O9o76ZdvQC@kreacher> (raw)
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Instead of evaluating _ADR in acpi_find_child_device(), use the
observation that it has already been evaluated and the value returned
by it has been stored in the pnp.type.bus_address field of the ACPI
device object at hand.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
Note that the patch at
https://patchwork.kernel.org/project/linux-acpi/patch/2223516.ElGaqSPkdT@kreacher/
will have an effect of this, so I'm going to prioritize the current patch
over the one above.
---
drivers/acpi/glue.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
Index: linux-pm/drivers/acpi/glue.c
===================================================================
--- linux-pm.orig/drivers/acpi/glue.c
+++ linux-pm/drivers/acpi/glue.c
@@ -113,13 +113,10 @@ struct acpi_device *acpi_find_child_devi
return NULL;
list_for_each_entry(adev, &parent->children, node) {
- unsigned long long addr;
- acpi_status status;
+ acpi_bus_address addr = acpi_device_adr(adev);
int score;
- status = acpi_evaluate_integer(adev->handle, METHOD_NAME__ADR,
- NULL, &addr);
- if (ACPI_FAILURE(status) || addr != address)
+ if (!adev->pnp.type.bus_address || addr != address)
continue;
if (!ret) {
next reply other threads:[~2021-10-27 16:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-27 16:59 Rafael J. Wysocki [this message]
2021-10-27 17:17 ` Andy Shevchenko
2021-10-27 17:23 ` Rafael J. Wysocki
2021-10-27 17:35 ` Andy Shevchenko
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=11862679.O9o76ZdvQC@kreacher \
--to=rjw@rjwysocki.net \
--cc=andriy.shevchenko@linux.intel.com \
--cc=hdegoede@redhat.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mika.westerberg@linux.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
all inboxes | Powered by JetHome®