diff options
author | Lv Zheng <lv.zheng@intel.com> | 2015-07-01 14:44:17 +0800 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-07-01 23:17:54 +0200 |
commit | 8f6f03610483962a9ebfaf38592909a3f0bcfa53 (patch) | |
tree | 855adcc25eb0301e918db300152dd372ca00aec1 /drivers/acpi/acpica/nssearch.c | |
parent | a8bd0f07eb594df51845d33f272fb1952fec1a6f (diff) |
ACPICA: Namespace: Add support to allow overriding objects
ACPICA commit 6084e34e44565c6293f446c0202b5e59b055e351
This patch adds an "NamespaceOverride" flag in struct acpi_walk_state, and allows
namespace objects to be overridden when this flag is set. Lv Zheng.
Link: https://github.com/acpica/acpica/commit/6084e34e
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/acpica/nssearch.c')
-rw-r--r-- | drivers/acpi/acpica/nssearch.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/drivers/acpi/acpica/nssearch.c b/drivers/acpi/acpica/nssearch.c index 4a9d4a66016e..47fbe5b33524 100644 --- a/drivers/acpi/acpica/nssearch.c +++ b/drivers/acpi/acpica/nssearch.c @@ -325,8 +325,26 @@ acpi_ns_search_and_enter(u32 target_name, * If we found it AND the request specifies that a find is an error, * return the error */ - if ((status == AE_OK) && (flags & ACPI_NS_ERROR_IF_FOUND)) { - status = AE_ALREADY_EXISTS; + if (status == AE_OK) { + + /* The node was found in the namespace */ + + /* + * If the namespace override feature is enabled for this node, + * delete any existing node. This can only happen during the + * boot stage, thus it is safe to remove the node here. + */ + if (flags & ACPI_NS_OVERRIDE_IF_FOUND) { + acpi_ns_delete_children(*return_node); + acpi_ns_remove_node(*return_node); + *return_node = ACPI_ENTRY_NOT_FOUND; + } + + /* Return an error if we don't expect to find the object */ + + else if (flags & ACPI_NS_ERROR_IF_FOUND) { + status = AE_ALREADY_EXISTS; + } } #ifdef ACPI_ASL_COMPILER if (*return_node && (*return_node)->type == ACPI_TYPE_ANY) { |