mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-06 14:31:46 +00:00
ACPI: bus: Refactor ACPI matching functions for better readability
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> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
1cd43acf0b
commit
fe79e392cf
1 changed files with 9 additions and 9 deletions
|
@ -925,12 +925,13 @@ static const void *acpi_of_device_get_match_data(const struct device *dev)
|
||||||
|
|
||||||
const void *acpi_device_get_match_data(const struct device *dev)
|
const void *acpi_device_get_match_data(const struct device *dev)
|
||||||
{
|
{
|
||||||
|
const struct acpi_device_id *acpi_ids = dev->driver->acpi_match_table;
|
||||||
const struct acpi_device_id *match;
|
const struct acpi_device_id *match;
|
||||||
|
|
||||||
if (!dev->driver->acpi_match_table)
|
if (!acpi_ids)
|
||||||
return acpi_of_device_get_match_data(dev);
|
return acpi_of_device_get_match_data(dev);
|
||||||
|
|
||||||
match = acpi_match_device(dev->driver->acpi_match_table, dev);
|
match = acpi_match_device(acpi_ids, dev);
|
||||||
if (!match)
|
if (!match)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -948,14 +949,13 @@ EXPORT_SYMBOL(acpi_match_device_ids);
|
||||||
bool acpi_driver_match_device(struct device *dev,
|
bool acpi_driver_match_device(struct device *dev,
|
||||||
const struct device_driver *drv)
|
const struct device_driver *drv)
|
||||||
{
|
{
|
||||||
if (!drv->acpi_match_table)
|
const struct acpi_device_id *acpi_ids = drv->acpi_match_table;
|
||||||
return acpi_of_match_device(ACPI_COMPANION(dev),
|
const struct of_device_id *of_ids = drv->of_match_table;
|
||||||
drv->of_match_table,
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
return __acpi_match_device(acpi_companion_match(dev),
|
if (!acpi_ids)
|
||||||
drv->acpi_match_table, drv->of_match_table,
|
return acpi_of_match_device(ACPI_COMPANION(dev), of_ids, NULL);
|
||||||
NULL, NULL);
|
|
||||||
|
return __acpi_match_device(acpi_companion_match(dev), acpi_ids, of_ids, NULL, NULL);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(acpi_driver_match_device);
|
EXPORT_SYMBOL_GPL(acpi_driver_match_device);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue