diff mbox

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

Message ID ac6f4ab97c46fab2a4d5580d12a71f154f6a2826.1414029477.git.lv.zheng@intel.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Lv Zheng Oct. 23, 2014, 2:12 a.m. UTC
This patch merges duplicate code to cleanup ACPI memory access
implementations. No functional changes.

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

Patch

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);