diff mbox series

[v1,2/5] ACPI: bus: Refactor acpi_driver_match_device() for better readability

Message ID 20220825164103.27694-2-andriy.shevchenko@linux.intel.com
State New
Headers show
Series [v1,1/5] ACPI: bus: Drop kernel doc annotation from acpi_bus_notify() | expand

Commit Message

Andy Shevchenko Aug. 25, 2022, 4:41 p.m. UTC
With temporary variables for OF and ACPI IDs, it's easier to read
the code. No functional change intended.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/acpi/bus.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index 8e87996607ec..c4d63c594d68 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -948,14 +948,13 @@  EXPORT_SYMBOL(acpi_match_device_ids);
 bool acpi_driver_match_device(struct device *dev,
 			      const struct device_driver *drv)
 {
-	if (!drv->acpi_match_table)
-		return acpi_of_match_device(ACPI_COMPANION(dev),
-					    drv->of_match_table,
-					    NULL);
-
-	return __acpi_match_device(acpi_companion_match(dev),
-				   drv->acpi_match_table, drv->of_match_table,
-				   NULL, NULL);
+	const struct acpi_device_id *acpi_ids = drv->acpi_match_table;
+	const struct of_device_id *of_ids = drv->of_match_table;
+
+	if (!acpi_ids)
+		return acpi_of_match_device(ACPI_COMPANION(dev), of_ids, NULL);
+
+	return __acpi_match_device(acpi_companion_match(dev), acpi_ids, of_ids, NULL, NULL);
 }
 EXPORT_SYMBOL_GPL(acpi_driver_match_device);