Skip to content

Commit b941820

Browse files
Heikki Krogerusrafaeljw
authored andcommitted
ACPI: OSL: Remove the helper for deactivating memory region
There are no more users for acpi_release_memory(). Signed-off-by: Heikki Krogerus <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent cdc3d2a commit b941820

File tree

2 files changed

+0
-89
lines changed

2 files changed

+0
-89
lines changed

drivers/acpi/osl.c

Lines changed: 0 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
#include <linux/io-64-nonatomic-lo-hi.h>
3737

3838
#include "acpica/accommon.h"
39-
#include "acpica/acnamesp.h"
4039
#include "internal.h"
4140

4241
/* Definitions for ACPI_DEBUG_PRINT() */
@@ -1496,91 +1495,6 @@ int acpi_check_region(resource_size_t start, resource_size_t n,
14961495
}
14971496
EXPORT_SYMBOL(acpi_check_region);
14981497

1499-
static acpi_status acpi_deactivate_mem_region(acpi_handle handle, u32 level,
1500-
void *_res, void **return_value)
1501-
{
1502-
struct acpi_mem_space_context **mem_ctx;
1503-
union acpi_operand_object *handler_obj;
1504-
union acpi_operand_object *region_obj2;
1505-
union acpi_operand_object *region_obj;
1506-
struct resource *res = _res;
1507-
acpi_status status;
1508-
1509-
region_obj = acpi_ns_get_attached_object(handle);
1510-
if (!region_obj)
1511-
return AE_OK;
1512-
1513-
handler_obj = region_obj->region.handler;
1514-
if (!handler_obj)
1515-
return AE_OK;
1516-
1517-
if (region_obj->region.space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY)
1518-
return AE_OK;
1519-
1520-
if (!(region_obj->region.flags & AOPOBJ_SETUP_COMPLETE))
1521-
return AE_OK;
1522-
1523-
region_obj2 = acpi_ns_get_secondary_object(region_obj);
1524-
if (!region_obj2)
1525-
return AE_OK;
1526-
1527-
mem_ctx = (void *)&region_obj2->extra.region_context;
1528-
1529-
if (!(mem_ctx[0]->address >= res->start &&
1530-
mem_ctx[0]->address < res->end))
1531-
return AE_OK;
1532-
1533-
status = handler_obj->address_space.setup(region_obj,
1534-
ACPI_REGION_DEACTIVATE,
1535-
NULL, (void **)mem_ctx);
1536-
if (ACPI_SUCCESS(status))
1537-
region_obj->region.flags &= ~(AOPOBJ_SETUP_COMPLETE);
1538-
1539-
return status;
1540-
}
1541-
1542-
/**
1543-
* acpi_release_memory - Release any mappings done to a memory region
1544-
* @handle: Handle to namespace node
1545-
* @res: Memory resource
1546-
* @level: A level that terminates the search
1547-
*
1548-
* Walks through @handle and unmaps all SystemMemory Operation Regions that
1549-
* overlap with @res and that have already been activated (mapped).
1550-
*
1551-
* This is a helper that allows drivers to place special requirements on memory
1552-
* region that may overlap with operation regions, primarily allowing them to
1553-
* safely map the region as non-cached memory.
1554-
*
1555-
* The unmapped Operation Regions will be automatically remapped next time they
1556-
* are called, so the drivers do not need to do anything else.
1557-
*/
1558-
acpi_status acpi_release_memory(acpi_handle handle, struct resource *res,
1559-
u32 level)
1560-
{
1561-
acpi_status status;
1562-
1563-
if (!(res->flags & IORESOURCE_MEM))
1564-
return AE_TYPE;
1565-
1566-
status = acpi_walk_namespace(ACPI_TYPE_REGION, handle, level,
1567-
acpi_deactivate_mem_region, NULL,
1568-
res, NULL);
1569-
if (ACPI_FAILURE(status))
1570-
return status;
1571-
1572-
/*
1573-
* Wait for all of the mappings queued up for removal by
1574-
* acpi_deactivate_mem_region() to actually go away.
1575-
*/
1576-
synchronize_rcu();
1577-
rcu_barrier();
1578-
flush_scheduled_work();
1579-
1580-
return AE_OK;
1581-
}
1582-
EXPORT_SYMBOL_GPL(acpi_release_memory);
1583-
15841498
/*
15851499
* Let drivers know whether the resource checks are effective
15861500
*/

include/linux/acpi.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -520,9 +520,6 @@ int acpi_check_resource_conflict(const struct resource *res);
520520
int acpi_check_region(resource_size_t start, resource_size_t n,
521521
const char *name);
522522

523-
acpi_status acpi_release_memory(acpi_handle handle, struct resource *res,
524-
u32 level);
525-
526523
int acpi_resources_are_enforced(void);
527524

528525
#ifdef CONFIG_HIBERNATION

0 commit comments

Comments
 (0)