Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf: Replace acpi_bus_get_device()

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 <rafael.j.wysocki@intel.com>
Acked-by: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/10025610.nUPlyArG6x@kreacher
Signed-off-by: Will Deacon <will@kernel.org>

authored by

Rafael J. Wysocki and committed by
Will Deacon
602c873e 8c0c5687

+4 -8
+2 -4
drivers/perf/thunderx2_pmu.c
··· 887 887 static acpi_status tx2_uncore_pmu_add(acpi_handle handle, u32 level, 888 888 void *data, void **return_value) 889 889 { 890 + struct acpi_device *adev = acpi_fetch_acpi_dev(handle); 890 891 struct tx2_uncore_pmu *tx2_pmu; 891 - struct acpi_device *adev; 892 892 enum tx2_uncore_type type; 893 893 894 - if (acpi_bus_get_device(handle, &adev)) 895 - return AE_OK; 896 - if (acpi_bus_get_status(adev) || !adev->status.present) 894 + if (!adev || acpi_bus_get_status(adev) || !adev->status.present) 897 895 return AE_OK; 898 896 899 897 type = get_tx2_pmu_type(adev);
+2 -4
drivers/perf/xgene_pmu.c
··· 1549 1549 static acpi_status acpi_pmu_dev_add(acpi_handle handle, u32 level, 1550 1550 void *data, void **return_value) 1551 1551 { 1552 + struct acpi_device *adev = acpi_fetch_acpi_dev(handle); 1552 1553 const struct acpi_device_id *acpi_id; 1553 1554 struct xgene_pmu *xgene_pmu = data; 1554 1555 struct xgene_pmu_dev_ctx *ctx; 1555 - struct acpi_device *adev; 1556 1556 1557 - if (acpi_bus_get_device(handle, &adev)) 1558 - return AE_OK; 1559 - if (acpi_bus_get_status(adev) || !adev->status.present) 1557 + if (!adev || acpi_bus_get_status(adev) || !adev->status.present) 1560 1558 return AE_OK; 1561 1559 1562 1560 acpi_id = xgene_pmu_acpi_match_type(xgene_pmu_acpi_type_match, adev);