Merge tag 'pci-v5.18-changes-2' of git://git.kernel.org/pub/scm/linux/kernel/git...
[sfrench/cifs-2.6.git] / drivers / tty / serdev / core.c
index 92e3433276f8aea24b17399bbc04de17ee6c62d4..0180e1e4e75df5a0e69a20aeb337613afbe762b5 100644 (file)
@@ -704,13 +704,10 @@ static const struct acpi_device_id serdev_acpi_devices_blacklist[] = {
 static acpi_status acpi_serdev_add_device(acpi_handle handle, u32 level,
                                          void *data, void **return_value)
 {
+       struct acpi_device *adev = acpi_fetch_acpi_dev(handle);
        struct serdev_controller *ctrl = data;
-       struct acpi_device *adev;
 
-       if (acpi_bus_get_device(handle, &adev))
-               return AE_OK;
-
-       if (acpi_device_enumerated(adev))
+       if (!adev || acpi_device_enumerated(adev))
                return AE_OK;
 
        /* Skip if black listed */