Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2663150pxb; Tue, 12 Oct 2021 10:53:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybE8l3fMz7jdt0kLqoMu4h/WP4YqS9NaoXhLNHX7MltdFHnutwvCVmPB9dFqPRRB/BdrUM X-Received: by 2002:a17:907:118d:: with SMTP id uz13mr36379285ejb.382.1634061208717; Tue, 12 Oct 2021 10:53:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634061208; cv=none; d=google.com; s=arc-20160816; b=b3sf0dKgj0ai+c8iO2OmZ3/GPqq8VzFK03CaT4R3Sjc/NCtW8OaI+K8INqhy37LtQL D6KwfskYRFIDOj12EwclyJxblKcCWsixzIgl4UR2eDgCQKJPHlesYnPKEa14vUv/4Fag QUNwA55mSkw1x6J7HGhbjfkD9KTHTCuoZWRqx8QGkB0CrWe4AmDMJG9JzIoS0Thhn+Fy fjB+cNeFjEusB4YGA7W0HcI8h3tTUCiak3Li596NVEG3DZy7IA17nklkDMGHgWdGjQ6b PkfkDuwnKQY4QjKc0NVPQmWbURTBhgD10dmESjKTNp/tPHgnqxg8IMvw8YDQqUY2mP1L hZTg== 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=pxaURc0UFPFEnVWFhhyFQQ3tAN4XJHdBYf86Jcdet30=; b=MOIX31dWhtbjHnCSznn/ANbbfxn1yhdtKs56Sd2VfTyVUFvUuD8a2n0EOpfkB+Db+5 wkVIhwRQ8JPXEVz1B4afSHNGxopIGc/HQ6OWE3dNcWZs+Pi9/B4vN0Whd3urfhleExjm Gqhc6eImjzS06T+Vmz17rM/OsfdVOrRLLXVIsI2qlon9hVA620lfCHZi3J3FgFCx2UBq YVd6H7+51TjsreTKWsD3+ssTY094wvNTUV2MP01+2ymA+riJKsuKv12gw1HQ/QxI5AQO BV4c4Ccv+xJpJwnxrFZ458BZ0oQUjxVxTWb826DEALQurs3bWLf3oivMJ7KBFzSfvz6z 8RMg== 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 di4si22352555ejc.505.2021.10.12.10.53.05; Tue, 12 Oct 2021 10:53:28 -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 S232532AbhJLRxO (ORCPT + 99 others); Tue, 12 Oct 2021 13:53:14 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:65156 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233005AbhJLRxN (ORCPT ); Tue, 12 Oct 2021 13:53:13 -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 3fae2874a0632811; Tue, 12 Oct 2021 19:51:10 +0200 Received: from kreacher.localnet (unknown [213.134.187.88]) (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 F2F3466A819; Tue, 12 Oct 2021 19:51:09 +0200 (CEST) From: "Rafael J. Wysocki" To: Linux ACPI Cc: LKML , Andy Gross , Bjorn Andersson , linux-arm-msm@vger.kernel.org Subject: [PATCH v1 7/7] perf: qcom_l2_pmu: ACPI: Use ACPI_COMPANION() directly Date: Tue, 12 Oct 2021 19:50:28 +0200 Message-ID: <3338400.QJadu78ljV@kreacher> In-Reply-To: <4369779.LvFx2qVVIh@kreacher> References: <4369779.LvFx2qVVIh@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 213.134.187.88 X-CLIENT-HOSTNAME: 213.134.187.88 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvtddrvddtkedguddugecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufffkfgjfhgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepvdejlefghfeiudektdelkeekvddugfeghffggeejgfeukeejleevgffgvdeluddtnecukfhppedvudefrddufeegrddukeejrdekkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvudefrddufeegrddukeejrdekkedphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedprhgtphhtthhopehlihhnuhigqdgrtghpihesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopegrghhrohhssheskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepsghjohhrnhdrrghnuggvrhhsshhonheslhhinhgrrhhordhorhhgpdhrtghpthhtoheplhhinhhugidqrghrmhdqmhhs mhesvhhgvghrrdhkvghrnhgvlhdrohhrgh 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 --- 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; }