spi: Replace custom code with device_match_acpi_handle()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 10 May 2024 20:49:52 +0000 (23:49 +0300)
committerMark Brown <broonie@kernel.org>
Mon, 27 May 2024 00:33:40 +0000 (01:33 +0100)
Since driver core provides a generic device_match_acpi_handle()
we may replace the custom code with it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://msgid.link/r/20240510204952.2582093-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi.c

index f94420858c224fb6238c98c213a3c7016305519d..26ef4e147681e460928ece53197704d392e6aa58 100644 (file)
@@ -2729,7 +2729,7 @@ static int acpi_spi_add_resource(struct acpi_resource *ares, void *data)
                                return -ENODEV;
 
                        if (ctlr) {
-                               if (ACPI_HANDLE(ctlr->dev.parent) != parent_handle)
+                               if (!device_match_acpi_handle(ctlr->dev.parent, parent_handle))
                                        return -ENODEV;
                        } else {
                                struct acpi_device *adev;
@@ -2828,7 +2828,7 @@ struct spi_device *acpi_spi_device_alloc(struct spi_controller *ctlr,
 
        if (!lookup.max_speed_hz &&
            ACPI_SUCCESS(acpi_get_parent(adev->handle, &parent_handle)) &&
-           ACPI_HANDLE(lookup.ctlr->dev.parent) == parent_handle) {
+           device_match_acpi_handle(lookup.ctlr->dev.parent, parent_handle)) {
                /* Apple does not use _CRS but nested devices for SPI slaves */
                acpi_spi_parse_apple_properties(adev, &lookup);
        }