Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1506817pxb; Tue, 26 Oct 2021 10:13:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx71TIAP0zP8mczWGzrlGfiVpp6VHBpZmCtVC+o81jUkXw3J368V6tEvlcW8TD2itqpjmxn X-Received: by 2002:a63:6ac2:: with SMTP id f185mr19979937pgc.326.1635268425839; Tue, 26 Oct 2021 10:13:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635268425; cv=none; d=google.com; s=arc-20160816; b=V+Bb+m/NTeFG4jyC7qyhX3w/bcG3tt8ugUCupTn+KpfH3V2nuhaD1T/13MoqtPRhB8 zruhWDs5Br9gwmpVc3IbBBSHANRvCZLvAA/C2yaPOF3KlM8YHmPyY1KVkT2C70nMKICV 0B6P3MonVOpdxJT4LK4QggGyBIMUM5dLfUT63lZOYgG/pijdM4+O1E83DuLY/jeu1V8w IMVZV4wdLki2gqVFLUtJJ1bqrbMsqofjMIkgpMMBTgEQ6DVqvcB5ezljgiuBb5XPAAoq tHTpn8CETEmp1us2jJonu6ldEdyQR0F7N/EzWHoaqE2AueNApthfJVslknwzp9PbPzhf 5iYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=ZLF/RSQc/WiflaSY0ZupsORfhON+Yiy4zLK9+j5ymtI=; b=mcbTdnUw7fBFXbeHYppGKhk0PuSZJwtv0tA1pvi7GcRlEtPGmQTmkZNNRBpoqK11ma DRvlhlNxSzGGoZY+M1wVrHdjlUEQcTLms4+7rYz1zwkzbE9ywfmAFPVI/juPhFQFF67B FHuW2bqUt2LZGzyUbR5hJ147q5f+SfRX8f0TGhM11MLEfWPWNCF6Dv/8PmsCR4cSvhSA uaiS9MQp4JF7sJsAL+1HHyUtoRmbKo6McY3EOG8C1pu0jQBFXa/qkknt92cu7BQfvXmK TvoFk40EDPbfpnLY63zHSo+ILp1QdrXbQXi/jofYw93zc41TA3YUKRpMLzi7Y3OkByc1 pO/g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i4si11458448pla.205.2021.10.26.10.13.29; Tue, 26 Oct 2021 10:13:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236158AbhJZNoo (ORCPT + 99 others); Tue, 26 Oct 2021 09:44:44 -0400 Received: from mail-ot1-f51.google.com ([209.85.210.51]:33554 "EHLO mail-ot1-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230420AbhJZNoj (ORCPT ); Tue, 26 Oct 2021 09:44:39 -0400 Received: by mail-ot1-f51.google.com with SMTP id 107-20020a9d0a74000000b00553bfb53348so2141053otg.0; Tue, 26 Oct 2021 06:42:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ZLF/RSQc/WiflaSY0ZupsORfhON+Yiy4zLK9+j5ymtI=; b=sI7ve687dTXw0k6/yy4Sj6sZVx69m0YJ/ex+sOc1wZyDqDj4cVQRKZdkBQK86Zqfdp 9+DjBNIkt/+21v5wx4xqyClixqzmqHSo26uU3GjPPluXU71lgJEDaG5dtx5zBc5tULX9 pUVtyL/VBO1KG8exaIpfT4lxNZ2dLsYr0JWqgLfhxzMOL4MID4gtcfoAYVw8Ai4ZmKpy KjdxRXlckjamlT7gJey2N3SsqUjKiVWQ21XJsM8wsEi2w+s3KNnpzTOBS3fpXpt+UGsn 4/mYgfywMAqp7PhAJFrEv5NEJZDNHB+TdQ6ijPwPlZuVFtxLaFRUKPt4XqqmmTasrg5g iFKw== X-Gm-Message-State: AOAM533TsXvi8KWoJ9dJN1aT6LAHWHGULqr9AaiFsgt3G2BB2vo/wgdx YfYJJTNWEZp7+d+bdt0w/cW7ybEUNvYYiWDMKGw= X-Received: by 2002:a9d:65c1:: with SMTP id z1mr19082692oth.198.1635255735613; Tue, 26 Oct 2021 06:42:15 -0700 (PDT) MIME-Version: 1.0 References: <4369779.LvFx2qVVIh@kreacher> <3338400.QJadu78ljV@kreacher> <21252081.EfDdHjke4D@kreacher> In-Reply-To: <21252081.EfDdHjke4D@kreacher> From: "Rafael J. Wysocki" Date: Tue, 26 Oct 2021 15:41:59 +0200 Message-ID: Subject: Re: [PATCH v2 7/7] perf: qcom_l2_pmu: ACPI: Use ACPI_COMPANION() directly To: "Rafael J. Wysocki" Cc: Linux ACPI , LKML , Andy Gross , Bjorn Andersson , linux-arm-msm Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 13, 2021 at 6:16 PM Rafael J. Wysocki wrote: > > From: Rafael J. Wysocki > > 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 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; > } > > >