Skip to contentSkip to conversation

perf: Replace acpi_bus_get_device()

PATCH Applied Rafael J. Wysocki 3 participants 4 messages Feb 1, 2022 – Feb 8, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf: Replace acpi_bus_get_device()

From: Rafael J. Wysocki <[email protected]>

Replace acpi_bus_get_device() that is going to be dropped with acpi_fetch_acpi_dev().

No intentional functional impact.

---
 drivers/perf/thunderx2_pmu.c |    6 ++----
 drivers/perf/xgene_pmu.c     |    6 ++----
 2 files changed, 4 insertions(+), 8 deletions(-)
drivers/perf/thunderx2_pmu.c +2 -4
Index: 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);
drivers/perf/xgene_pmu.c +2 -4
Index: 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);
maintainer Acked-by on v1 1/1
#1 lore raw

Hi Rafael,

Quoted 5 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

Replace acpi_bus_get_device() that is going to be dropped with acpi_fetch_acpi_dev().

Quoted 7 lines

No intentional functional impact.

---
 drivers/perf/thunderx2_pmu.c |    6 ++----
 drivers/perf/xgene_pmu.c     |    6 ++----
 2 files changed, 4 insertions(+), 8 deletions(-)

Please let me know if you'd like me to take this for 5.18.

Will

#2 lore raw
Quoted 17 lines · Will Deacon

Hi Rafael,

Quoted 5 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

Replace acpi_bus_get_device() that is going to be dropped with acpi_fetch_acpi_dev().

Quoted 7 lines

No intentional functional impact.

---
 drivers/perf/thunderx2_pmu.c |    6 ++----
 drivers/perf/xgene_pmu.c     |    6 ++----
 2 files changed, 4 insertions(+), 8 deletions(-)
Quoted 3 lines

Please let me know if you'd like me to take this for 5.18.

Yes, please!

maintainer Applied
#3 lore raw
In reply to Rafael J. Wysocki
Quoted 8 lines · Rafael J. Wysocki

From: Rafael J. Wysocki <[email protected]>

Replace acpi_bus_get_device() that is going to be dropped with acpi_fetch_acpi_dev().

No intentional functional impact.

[...]

Applied to will (for-next/perf), thanks!

[1/1] perf: Replace acpi_bus_get_device()

      https://git.kernel.org/will/c/602c873eb52e

Cheers,

Signature · 5 lines
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev