ACPI / bind: Redefine acpi_preset_companion()
Modify acpi_preset_companion() to take a struct acpi_device pointer instead of an ACPI handle as its second argument and redefine it as a static inline wrapper around ACPI_COMPANION_SET() passing the return value of acpi_find_child_device() directly as the second argument to it. Update its users to pass struct acpi_device pointers instead of ACPI handles to it. This allows some unnecessary acpi_bus_get_device() calls to be avoided. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Aaron Lu <aaron.lu@intel.com> Tested-by: Aaron Lu <aaron.lu@intel.com> # for ATA binding
This commit is contained in:
@@ -308,7 +308,7 @@ static void sdio_acpi_set_handle(struct sdio_func *func)
|
||||
struct mmc_host *host = func->card->host;
|
||||
u64 addr = (host->slotno << 16) | func->num;
|
||||
|
||||
acpi_preset_companion(&func->dev, ACPI_HANDLE(host->parent), addr);
|
||||
acpi_preset_companion(&func->dev, ACPI_COMPANION(host->parent), addr);
|
||||
}
|
||||
#else
|
||||
static inline void sdio_acpi_set_handle(struct sdio_func *func) {}
|
||||
|
||||
Reference in New Issue
Block a user