Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3609820pxb; Wed, 13 Oct 2021 09:19:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYFQWFDS7GXnLopuadO8KvRIDI851oiOf62xSleQi1SF3Bzah7DOKg7k7Iy/H3ozJCi4X4 X-Received: by 2002:aa7:9542:0:b0:44c:6db9:f596 with SMTP id w2-20020aa79542000000b0044c6db9f596mr273504pfq.21.1634141943720; Wed, 13 Oct 2021 09:19:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634141943; cv=none; d=google.com; s=arc-20160816; b=ZCvne5eqEv2l2Cxr4qUtn6M8lnKifdcMQP0GQDWJC6CjfhWMnYEn/S9qbAINExdm6a ysiQT3WO1dJJeVYPGIxFKmgZ6g4f/3aidzs9Ra6BI3MvqMnHvG5aD3Wk1lp7TCt6s5Yz 5LHwGwPTnD1n15GW4Lm8qrZiLNh1DBPqdzh+e2jjlZeJHGIKy/jmsN33bIwIcPAx91X8 jgEZ4sRi8B9WalF5QAZITnRDVkx7z+BAtKFftV6z40z8cmTSQe0gZdaBPKtcrZolIN1x AL0yccalrE/3feQpKp+6QDYafB1Gv4AEbPHM55i/nwmT+/feVM50fokHtQRttnvAw5Dg 1ANQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=wH8+FHlznEooLaHIvVsQF/Q56Tn0l3iAHHZ4JCVHhew=; b=CPi0uLrXKziiAMwpwiYQ4sOBuOa2Zppj2B0XEUgyDgSTgDeD3o3XNaj/VPHHoYsG0V kyp2fbrm4v8Y2/yF4N1IYRpBFH5/4zR1/VWEGfPdWMIBUKRQNBzkS7yjW0Ws1sH5vpZp jOkbVOKFRxK1jqNFGdr9h6LHcZxKM7vAGi8+P38lidpREQsrEgVJUCOo3LcZBW1oxuus dPBjj1M/DHHOfnnjTxKKd0UkyxEz4MIKLUzh3vw2ARctf5+0Jh+SLZXNMtLTtnHi88tc rPml27g3gPB7jTpiXDom1CuuCs5uyFmfapPtmvNgFuz/DPFTCMpqTBYdyDJSUpqvHo1g m8xQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g187si18318981pgc.217.2021.10.13.09.18.04; Wed, 13 Oct 2021 09:19:03 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230110AbhJMQSg (ORCPT + 99 others); Wed, 13 Oct 2021 12:18:36 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:59708 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229529AbhJMQSe (ORCPT ); Wed, 13 Oct 2021 12:18:34 -0400 Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 3.0.0) id ec34a90093cf9904; Wed, 13 Oct 2021 18:16:30 +0200 Received: from kreacher.localnet (unknown [213.134.161.244]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by v370.home.net.pl (Postfix) with ESMTPSA id 3B18D66A871; Wed, 13 Oct 2021 18:16:29 +0200 (CEST) From: "Rafael J. Wysocki" To: Linux ACPI Cc: LKML , Andy Gross , Bjorn Andersson , linux-arm-msm@vger.kernel.org Subject: [PATCH v2 7/7] perf: qcom_l2_pmu: ACPI: Use ACPI_COMPANION() directly Date: Wed, 13 Oct 2021 18:15:33 +0200 Message-ID: <21252081.EfDdHjke4D@kreacher> In-Reply-To: <3338400.QJadu78ljV@kreacher> References: <4369779.LvFx2qVVIh@kreacher> <3338400.QJadu78ljV@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 213.134.161.244 X-CLIENT-HOSTNAME: 213.134.161.244 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvtddrvddutddgleeiucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffufffkjghfggfgtgesthfuredttddtjeenucfhrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqeenucggtffrrghtthgvrhhnpedvjeelgffhiedukedtleekkedvudfggefhgfegjefgueekjeelvefggfdvledutdenucfkphepvddufedrudefgedrudeiuddrvdeggeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvudefrddufeegrdduiedurddvgeegpdhhvghlohepkhhrvggrtghhvghrrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqpdhrtghpthhtoheplhhinhhugidqrggtphhisehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheprghgrhhoshhssehkvghrnhgvlhdrohhrghdprhgtphhtthhopegsjhhorhhnrdgrnhguvghrshhsohhnsehlihhnrghrohdrohhrghdprhgtphhtthhopehlihhnuhigqdgrrhhmqdhm shhmsehvghgvrhdrkhgvrhhnvghlrdhorhhg X-DCC--Metrics: v370.home.net.pl 1024; Body=5 Fuz1=5 Fuz2=5 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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; }