platform/surface: Replace acpi_bus_get_device()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 26 Jan 2022 19:41:27 +0000 (20:41 +0100)
committerHans de Goede <hdegoede@redhat.com>
Thu, 3 Feb 2022 10:56:01 +0000 (11:56 +0100)
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>
Reviewed-by: Maximilian Luz <luzmaximilian@gmail.com>
Link: https://lore.kernel.org/r/5805278.lOV4Wx5bFT@kreacher
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/surface/surface3-wmi.c
drivers/platform/surface/surface_acpi_notify.c

index 09ac9cfc40d8e6a80ec83b40a02cea2ff092863f..089a8a48d920c3cfa9caf1d7a884b8290b8f53d9 100644 (file)
@@ -116,15 +116,11 @@ static acpi_status s3_wmi_attach_spi_device(acpi_handle handle,
                                            void *data,
                                            void **return_value)
 {
-       struct acpi_device *adev, **ts_adev;
+       struct acpi_device *adev = acpi_fetch_acpi_dev(handle);
+       struct acpi_device **ts_adev = data;
 
-       if (acpi_bus_get_device(handle, &adev))
-               return AE_OK;
-
-       ts_adev = data;
-
-       if (strncmp(acpi_device_bid(adev), SPI_TS_OBJ_NAME,
-           strlen(SPI_TS_OBJ_NAME)))
+       if (!adev || strncmp(acpi_device_bid(adev), SPI_TS_OBJ_NAME,
+                            strlen(SPI_TS_OBJ_NAME)))
                return AE_OK;
 
        if (*ts_adev) {
index 8339988d95c1b08ec91298180bcfa6aa5b4fb410..7b758f8cc137e2780a3375381c8790097aef4809 100644 (file)
@@ -770,7 +770,8 @@ static acpi_status san_consumer_setup(acpi_handle handle, u32 lvl,
                return AE_OK;
 
        /* Ignore ACPI devices that are not present. */
-       if (acpi_bus_get_device(handle, &adev) != 0)
+       adev = acpi_fetch_acpi_dev(handle);
+       if (!adev)
                return AE_OK;
 
        san_consumer_dbg(&pdev->dev, handle, "creating device link\n");