Merge tag 'for-5.18-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux
[linux-2.6-microblaze.git] / drivers / perf / thunderx2_pmu.c
index 05378c0..1edb9c0 100644 (file)
@@ -887,13 +887,11 @@ static struct tx2_uncore_pmu *tx2_uncore_pmu_init_dev(struct device *dev,
 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);