[PATCH 3/6] ACPI/OSL: Cleanup memory access functions by merging duplicate code.

From: Lv Zheng
Date: Wed Oct 22 2014 - 22:12:34 EST


This patch merges duplicate code to cleanup ACPI memory access
implementations. No functional changes.

Signed-off-by: Lv Zheng <lv.zheng@xxxxxxxxx>
Tested-by: Fei Yang <fei.yang@xxxxxxxxx>
---
drivers/acpi/mem.c | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/drivers/acpi/mem.c b/drivers/acpi/mem.c
index defd317..ba74086 100644
--- a/drivers/acpi/mem.c
+++ b/drivers/acpi/mem.c
@@ -260,7 +260,6 @@ EXPORT_SYMBOL(acpi_os_map_generic_address);
void acpi_os_unmap_generic_address(struct acpi_generic_address *gas)
{
u64 addr;
- struct acpi_ioremap *map;

if (gas->space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY)
return;
@@ -270,16 +269,8 @@ void acpi_os_unmap_generic_address(struct acpi_generic_address *gas)
if (!addr || !gas->bit_width)
return;

- mutex_lock(&acpi_ioremap_lock);
- map = acpi_map_lookup_phys(addr, gas->bit_width / 8);
- if (!map) {
- mutex_unlock(&acpi_ioremap_lock);
- return;
- }
- acpi_map_put(map);
- mutex_unlock(&acpi_ioremap_lock);
-
- acpi_map_cleanup(map);
+ acpi_os_unmap_iomem((void __iomem *)((unsigned long)addr),
+ gas->bit_width / 8);
}
EXPORT_SYMBOL(acpi_os_unmap_generic_address);

--
1.7.10

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/