diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2020-07-02 15:14:05 +0300 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2020-07-27 13:30:00 +0300 |
commit | 5003ad7172651e550103389b59b0dbeaebf65d00 (patch) | |
tree | 661c5ecbdee31e0d501b7a11907fe371311e8931 /drivers/acpi/osl.c | |
parent | a968fba29733af162d9543b422d035c8869b9298 (diff) | |
download | linux-5003ad7172651e550103389b59b0dbeaebf65d00.tar.xz |
ACPI: OSL: Clean up the removal of unused memory mappings
Fold acpi_os_map_cleanup_deferred() into acpi_os_map_remove() and
pass the latter to INIT_RCU_WORK() in acpi_os_drop_map_ref() to make
the code more straightforward.
No intentional functional impact.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/osl.c')
-rw-r--r-- | drivers/acpi/osl.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 816d9f8ac6b6..6ad8cb05f672 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -377,18 +377,16 @@ void *__ref acpi_os_map_memory(acpi_physical_address phys, acpi_size size) } EXPORT_SYMBOL_GPL(acpi_os_map_memory); -static void acpi_os_map_remove(struct acpi_ioremap *map) +static void acpi_os_map_remove(struct work_struct *work) { + struct acpi_ioremap *map = container_of(to_rcu_work(work), + struct acpi_ioremap, + track.rwork); + acpi_unmap(map->phys, map->virt); kfree(map); } -static void acpi_os_map_cleanup_deferred(struct work_struct *work) -{ - acpi_os_map_remove(container_of(to_rcu_work(work), struct acpi_ioremap, - track.rwork)); -} - /* Must be called with mutex_lock(&acpi_ioremap_lock) */ static void acpi_os_drop_map_ref(struct acpi_ioremap *map) { @@ -397,7 +395,7 @@ static void acpi_os_drop_map_ref(struct acpi_ioremap *map) list_del_rcu(&map->list); - INIT_RCU_WORK(&map->track.rwork, acpi_os_map_cleanup_deferred); + INIT_RCU_WORK(&map->track.rwork, acpi_os_map_remove); queue_rcu_work(system_wq, &map->track.rwork); } |