linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rafael@kernel.org>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Linux ACPI <linux-acpi@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Andy Gross <agross@kernel.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	linux-arm-msm <linux-arm-msm@vger.kernel.org>
Subject: Re: [PATCH v2 7/7] perf: qcom_l2_pmu: ACPI: Use ACPI_COMPANION() directly
Date: Tue, 26 Oct 2021 15:41:59 +0200	[thread overview]
Message-ID: <CAJZ5v0gOUdM64FqkeXmGd+Zyc5a_u=RBC6S2rxM4F5oTJ57wNw@mail.gmail.com> (raw)
In-Reply-To: <21252081.EfDdHjke4D@kreacher>

On Wed, Oct 13, 2021 at 6:16 PM Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
>
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> The ACPI_HANDLE() macro is a wrapper arond the ACPI_COMPANION()
> macro and the ACPI handle produced by the former comes from the
> ACPI device object produced by the latter, so it is way more
> straightforward to evaluate the latter directly instead of passing
> the handle produced by the former to acpi_bus_get_device().
>
> Modify l2_cache_pmu_probe_cluster() accordingly (no intentional
> functional impact).
>
> While at it, rename the ACPI device pointer to adev for more
> clarity.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

If nobody nas any concerns regarding this patch, I will queue it up
for 5.16 in the ACPI tree, because it is requisite for further
changes.

Thanks!

> ---
>
> v1 -> v2:
>    * Resend with a different From and S-o-b address.  No other changes.
>
> ---
>  drivers/perf/qcom_l2_pmu.c |    7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
>
> Index: linux-pm/drivers/perf/qcom_l2_pmu.c
> ===================================================================
> --- linux-pm.orig/drivers/perf/qcom_l2_pmu.c
> +++ linux-pm/drivers/perf/qcom_l2_pmu.c
> @@ -840,17 +840,14 @@ static int l2_cache_pmu_probe_cluster(st
>  {
>         struct platform_device *pdev = to_platform_device(dev->parent);
>         struct platform_device *sdev = to_platform_device(dev);
> +       struct acpi_device *adev = ACPI_COMPANION(dev);
>         struct l2cache_pmu *l2cache_pmu = data;
>         struct cluster_pmu *cluster;
> -       struct acpi_device *device;
>         unsigned long fw_cluster_id;
>         int err;
>         int irq;
>
> -       if (acpi_bus_get_device(ACPI_HANDLE(dev), &device))
> -               return -ENODEV;
> -
> -       if (kstrtoul(device->pnp.unique_id, 10, &fw_cluster_id) < 0) {
> +       if (!adev || kstrtoul(adev->pnp.unique_id, 10, &fw_cluster_id) < 0) {
>                 dev_err(&pdev->dev, "unable to read ACPI uid\n");
>                 return -ENODEV;
>         }
>
>
>

      reply	other threads:[~2021-10-26 13:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4369779.LvFx2qVVIh@kreacher>
2021-10-12 17:50 ` [PATCH v1 7/7] perf: qcom_l2_pmu: ACPI: Use ACPI_COMPANION() directly Rafael J. Wysocki
2021-10-13 16:15   ` [PATCH v2 " Rafael J. Wysocki
2021-10-26 13:41     ` Rafael J. Wysocki [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='CAJZ5v0gOUdM64FqkeXmGd+Zyc5a_u=RBC6S2rxM4F5oTJ57wNw@mail.gmail.com' \
    --to=rafael@kernel.org \
    --cc=agross@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).