From: Bjorn Helgaas <helgaas@kernel.org>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>,
Linux PCI <linux-pci@vger.kernel.org>,
Linux ACPI <linux-acpi@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] PCI: ACPI: Replace acpi_bus_get_device()
Date: Fri, 4 Feb 2022 17:14:44 -0600 [thread overview]
Message-ID: <20220204231444.GA228064@bhelgaas> (raw)
In-Reply-To: <11930209.O9o76ZdvQC@kreacher>
On Thu, Jan 27, 2022 at 12:40:13AM +0100, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> Replace acpi_bus_get_device() that is going to be dropped with
> acpi_fetch_acpi_dev().
>
> No intentional functional impact.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Applied with Mika's Reviewed-by to pci/acpi for v5.18, thanks!
> ---
>
> -> v2: Fix typo (superfluous paren) in acpiphp_ibm.c.
>
> ---
> drivers/pci/hotplug/acpiphp_glue.c | 7 ++++---
> drivers/pci/hotplug/acpiphp_ibm.c | 5 +++--
> drivers/pci/pci-acpi.c | 6 +++---
> 3 files changed, 10 insertions(+), 8 deletions(-)
>
> Index: linux-pm/drivers/pci/hotplug/acpiphp_glue.c
> ===================================================================
> --- linux-pm.orig/drivers/pci/hotplug/acpiphp_glue.c
> +++ linux-pm/drivers/pci/hotplug/acpiphp_glue.c
> @@ -226,9 +226,9 @@ static void acpiphp_post_dock_fixup(stru
> static acpi_status acpiphp_add_context(acpi_handle handle, u32 lvl, void *data,
> void **rv)
> {
> + struct acpi_device *adev = acpi_fetch_acpi_dev(handle);
> struct acpiphp_bridge *bridge = data;
> struct acpiphp_context *context;
> - struct acpi_device *adev;
> struct acpiphp_slot *slot;
> struct acpiphp_func *newfunc;
> acpi_status status = AE_OK;
> @@ -238,6 +238,9 @@ static acpi_status acpiphp_add_context(a
> struct pci_dev *pdev = bridge->pci_dev;
> u32 val;
>
> + if (!adev)
> + return AE_OK;
> +
> status = acpi_evaluate_integer(handle, "_ADR", NULL, &adr);
> if (ACPI_FAILURE(status)) {
> if (status != AE_NOT_FOUND)
> @@ -245,8 +248,6 @@ static acpi_status acpiphp_add_context(a
> "can't evaluate _ADR (%#x)\n", status);
> return AE_OK;
> }
> - if (acpi_bus_get_device(handle, &adev))
> - return AE_OK;
>
> device = (adr >> 16) & 0xffff;
> function = adr & 0xffff;
> Index: linux-pm/drivers/pci/hotplug/acpiphp_ibm.c
> ===================================================================
> --- linux-pm.orig/drivers/pci/hotplug/acpiphp_ibm.c
> +++ linux-pm/drivers/pci/hotplug/acpiphp_ibm.c
> @@ -433,8 +433,9 @@ static int __init ibm_acpiphp_init(void)
> goto init_return;
> }
> pr_debug("%s: found IBM aPCI device\n", __func__);
> - if (acpi_bus_get_device(ibm_acpi_handle, &device)) {
> - pr_err("%s: acpi_bus_get_device failed\n", __func__);
> + device = acpi_fetch_acpi_dev(ibm_acpi_handle);
> + if (!device) {
> + pr_err("%s: acpi_fetch_acpi_dev failed\n", __func__);
> retval = -ENODEV;
> goto init_return;
> }
> Index: linux-pm/drivers/pci/pci-acpi.c
> ===================================================================
> --- linux-pm.orig/drivers/pci/pci-acpi.c
> +++ linux-pm/drivers/pci/pci-acpi.c
> @@ -89,9 +89,9 @@ int acpi_get_rc_resources(struct device
> return -ENODEV;
> }
>
> - ret = acpi_bus_get_device(handle, &adev);
> - if (ret)
> - return ret;
> + adev = acpi_fetch_acpi_dev(handle);
> + if (!adev)
> + return -ENODEV;
>
> ret = acpi_get_rc_addr(adev, res);
> if (ret) {
>
>
>
prev parent reply other threads:[~2022-02-04 23:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-26 23:40 [PATCH v2] PCI: ACPI: Replace acpi_bus_get_device() Rafael J. Wysocki
2022-01-27 6:25 ` Mika Westerberg
2022-02-04 23:14 ` Bjorn Helgaas [this message]
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=20220204231444.GA228064@bhelgaas \
--to=helgaas@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=rjw@rjwysocki.net \
/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