Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1309907pxb; Wed, 2 Feb 2022 01:49:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJwd2YWtMNZyQGbRezzE+wd0umatxx7BzaZDHy4Eu7d5AS2XuGnkE2wxFvddjMHDjE6ku8f8 X-Received: by 2002:a17:906:794c:: with SMTP id l12mr25643015ejo.116.1643795354073; Wed, 02 Feb 2022 01:49:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643795354; cv=none; d=google.com; s=arc-20160816; b=MP+k+T5S1xpQNSQoE/qz/+sRGzXvq/15N2UkioGR1zru2IHGLWR3RsErTrsrcGwQVx wcp7qbulb3jPce1CvNtp4b5z92Fw2olExPWYNbU01rdshwBHp25wdq+S1vECwTLCeX2c Ro517iEhRXooU7hVg4utfXj4Fc0Q1kunJhLZuUkbIueu3wFKlDFS1zISDJMgQ2+0uzYt Lqjqb8Zdn8xn7HNtRIwslcZvKW7i7vFqkrYxXV9511cXnQX61tqDWByhvSYjecZRVZa2 vQbi3BHNpzL6sSVK/MZal1hBaNVdtd8GQILvFpMBNQNCr7af7yA7V6hLGfNBU8azSbQG Vk/g== 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 :message-id:date:subject:cc:to:from; bh=L1wG44AZ9WgGJ3saR2+I2LJEPdXJxkQpzGQReFsMmKU=; b=QzRJFussu+uWKPCCZJxVU4WQF7lEpG4SWh3DlZqti+Ksf/L+iZxTkdL4lAyRxL+NgY BrmNws1vpC+yRtlO4WCIkgrI/iNc21J4tQ+RYmCaUsisHkcFoKciH8kLhpj9I6f7ooBJ GZVxihjVI9KI+ipfLzjN423sFBS137UF8OodhUgp4hdAp6mJcSIelGcbNsLOkqPilayM bzIkmCQvqd2t4mQ6obES2VPK3sYvEKOnm/fEzqrjrugYO6Zu3COQhRnlfqIn3Z/JCG1B gesLeL9fLziOoNGKUoXLXMXFoeEz8wqOi5BYctjvXbqhzNKviIv01F/fP+wXEP1nxPG0 6JgA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g22si12906574edb.619.2022.02.02.01.48.48; Wed, 02 Feb 2022 01:49:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242333AbiBATKF (ORCPT + 99 others); Tue, 1 Feb 2022 14:10:05 -0500 Received: from cloudserver094114.home.pl ([79.96.170.134]:55632 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232783AbiBATKD (ORCPT ); Tue, 1 Feb 2022 14:10:03 -0500 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 4.0.0) id 00adadc5ffba56da; Tue, 1 Feb 2022 20:10:02 +0100 Received: from kreacher.localnet (unknown [213.134.162.64]) (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 D9E7066B3BC; Tue, 1 Feb 2022 20:10:01 +0100 (CET) From: "Rafael J. Wysocki" To: Will Deacon , Mark Rutland Cc: Khuong Dinh , LKML , Linux ACPI , linux-arm-kernel@lists.infradead.org Subject: [PATCH] perf: Replace acpi_bus_get_device() Date: Tue, 01 Feb 2022 20:10:01 +0100 Message-ID: <10025610.nUPlyArG6x@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 213.134.162.64 X-CLIENT-HOSTNAME: 213.134.162.64 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvvddrgeefgdduvddtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffufffkggfgtgesthfuredttddtjeenucfhrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqeenucggtffrrghtthgvrhhnpefhgedtffejheekgeeljeevvedtuefgffeiieejuddutdekgfejvdehueejjeetvdenucfkphepvddufedrudefgedrudeivddrieegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvddufedrudefgedrudeivddrieegpdhhvghlohepkhhrvggrtghhvghrrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqpdhnsggprhgtphhtthhopeeipdhrtghpthhtohepfihilhhlsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehmrghrkhdrrhhuthhlrghnugesrghrmhdrtghomhdprhgtphhtthhopehkhhhuohhnghesohhsrdgrmhhpvghrvggtohhmphhuthhinhhgrdgtohhmpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqrggt phhisehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqrghrmhdqkhgvrhhnvghlsehlihhsthhsrdhinhhfrhgruggvrggurdhorhhg X-DCC--Metrics: v370.home.net.pl 1024; Body=6 Fuz1=6 Fuz2=6 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki 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 --- drivers/perf/thunderx2_pmu.c | 6 ++---- drivers/perf/xgene_pmu.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) Index: linux-pm/drivers/perf/thunderx2_pmu.c =================================================================== --- linux-pm.orig/drivers/perf/thunderx2_pmu.c +++ linux-pm/drivers/perf/thunderx2_pmu.c @@ -887,13 +887,11 @@ static struct tx2_uncore_pmu *tx2_uncore static acpi_status tx2_uncore_pmu_add(acpi_handle handle, u32 level, void *data, void **return_value) { + struct acpi_device *adev = acpi_fetch_acpi_dev(handle); struct tx2_uncore_pmu *tx2_pmu; - struct acpi_device *adev; enum tx2_uncore_type type; - if (acpi_bus_get_device(handle, &adev)) - return AE_OK; - if (acpi_bus_get_status(adev) || !adev->status.present) + if (!adev || acpi_bus_get_status(adev) || !adev->status.present) return AE_OK; type = get_tx2_pmu_type(adev); Index: linux-pm/drivers/perf/xgene_pmu.c =================================================================== --- linux-pm.orig/drivers/perf/xgene_pmu.c +++ linux-pm/drivers/perf/xgene_pmu.c @@ -1549,14 +1549,12 @@ static const struct acpi_device_id *xgen static acpi_status acpi_pmu_dev_add(acpi_handle handle, u32 level, void *data, void **return_value) { + struct acpi_device *adev = acpi_fetch_acpi_dev(handle); const struct acpi_device_id *acpi_id; struct xgene_pmu *xgene_pmu = data; struct xgene_pmu_dev_ctx *ctx; - struct acpi_device *adev; - if (acpi_bus_get_device(handle, &adev)) - return AE_OK; - if (acpi_bus_get_status(adev) || !adev->status.present) + if (!adev || acpi_bus_get_status(adev) || !adev->status.present) return AE_OK; acpi_id = xgene_pmu_acpi_match_type(xgene_pmu_acpi_type_match, adev);