diff options
author | Lv Zheng <lv.zheng@intel.com> | 2015-01-26 03:58:48 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-01-26 10:08:49 -0500 |
commit | e044d8f92f79db167bb7f9dfd0f317e3238d82d1 (patch) | |
tree | 682e368f69212caf930a0c56701eba3f41f71bdd /drivers/acpi | |
parent | 97d746578b1fc4ce461e6279220cab3605f02469 (diff) |
ACPI: Introduce acpi_unload_parent_table() usages in Linux kernel
ACPICA has implemented acpi_unload_parent_table() which can exactly replace
the acpi_get_id()/acpi_unload_table_id() implemented in Linux kernel. The
acpi_unload_parent_table() has been unit tested in ACPICA simulation
environment.
This patch can also help to reduce the source code differences between
Linux and ACPICA.
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Tested-by: Octavian Purdila <octavian.purdila@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/acpica/nsxfobj.c | 44 | ||||
-rw-r--r-- | drivers/acpi/acpica/tbxface.c | 46 |
2 files changed, 0 insertions, 90 deletions
diff --git a/drivers/acpi/acpica/nsxfobj.c b/drivers/acpi/acpica/nsxfobj.c index dae9401be7a2..51a83298c18d 100644 --- a/drivers/acpi/acpica/nsxfobj.c +++ b/drivers/acpi/acpica/nsxfobj.c | |||
@@ -53,50 +53,6 @@ ACPI_MODULE_NAME("nsxfobj") | |||
53 | 53 | ||
54 | /******************************************************************************* | 54 | /******************************************************************************* |
55 | * | 55 | * |
56 | * FUNCTION: acpi_get_id | ||
57 | * | ||
58 | * PARAMETERS: Handle - Handle of object whose id is desired | ||
59 | * ret_id - Where the id will be placed | ||
60 | * | ||
61 | * RETURN: Status | ||
62 | * | ||
63 | * DESCRIPTION: This routine returns the owner id associated with a handle | ||
64 | * | ||
65 | ******************************************************************************/ | ||
66 | acpi_status acpi_get_id(acpi_handle handle, acpi_owner_id * ret_id) | ||
67 | { | ||
68 | struct acpi_namespace_node *node; | ||
69 | acpi_status status; | ||
70 | |||
71 | /* Parameter Validation */ | ||
72 | |||
73 | if (!ret_id) { | ||
74 | return (AE_BAD_PARAMETER); | ||
75 | } | ||
76 | |||
77 | status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE); | ||
78 | if (ACPI_FAILURE(status)) { | ||
79 | return (status); | ||
80 | } | ||
81 | |||
82 | /* Convert and validate the handle */ | ||
83 | |||
84 | node = acpi_ns_validate_handle(handle); | ||
85 | if (!node) { | ||
86 | (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); | ||
87 | return (AE_BAD_PARAMETER); | ||
88 | } | ||
89 | |||
90 | *ret_id = node->owner_id; | ||
91 | |||
92 | status = acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); | ||
93 | return (status); | ||
94 | } | ||
95 | |||
96 | ACPI_EXPORT_SYMBOL(acpi_get_id) | ||
97 | |||
98 | /******************************************************************************* | ||
99 | * | ||
100 | * FUNCTION: acpi_get_type | 56 | * FUNCTION: acpi_get_type |
101 | * | 57 | * |
102 | * PARAMETERS: handle - Handle of object whose type is desired | 58 | * PARAMETERS: handle - Handle of object whose type is desired |
diff --git a/drivers/acpi/acpica/tbxface.c b/drivers/acpi/acpica/tbxface.c index 9520ae19bb37..0f9dd80b1cdd 100644 --- a/drivers/acpi/acpica/tbxface.c +++ b/drivers/acpi/acpica/tbxface.c | |||
@@ -265,52 +265,6 @@ ACPI_EXPORT_SYMBOL(acpi_get_table_header) | |||
265 | 265 | ||
266 | /******************************************************************************* | 266 | /******************************************************************************* |
267 | * | 267 | * |
268 | * FUNCTION: acpi_unload_table_id | ||
269 | * | ||
270 | * PARAMETERS: id - Owner ID of the table to be removed. | ||
271 | * | ||
272 | * RETURN: Status | ||
273 | * | ||
274 | * DESCRIPTION: This routine is used to force the unload of a table (by id) | ||
275 | * | ||
276 | ******************************************************************************/ | ||
277 | acpi_status acpi_unload_table_id(acpi_owner_id id) | ||
278 | { | ||
279 | int i; | ||
280 | acpi_status status = AE_NOT_EXIST; | ||
281 | |||
282 | ACPI_FUNCTION_TRACE(acpi_unload_table_id); | ||
283 | |||
284 | status = acpi_ut_acquire_mutex(ACPI_MTX_INTERPRETER); | ||
285 | if (ACPI_FAILURE(status)) { | ||
286 | return_ACPI_STATUS(status); | ||
287 | } | ||
288 | |||
289 | /* Find table in the global table list */ | ||
290 | for (i = 0; i < acpi_gbl_root_table_list.current_table_count; ++i) { | ||
291 | if (id != acpi_gbl_root_table_list.tables[i].owner_id) { | ||
292 | continue; | ||
293 | } | ||
294 | /* | ||
295 | * Delete all namespace objects owned by this table. Note that these | ||
296 | * objects can appear anywhere in the namespace by virtue of the AML | ||
297 | * "Scope" operator. Thus, we need to track ownership by an ID, not | ||
298 | * simply a position within the hierarchy | ||
299 | */ | ||
300 | acpi_tb_delete_namespace_by_owner(i); | ||
301 | status = acpi_tb_release_owner_id(i); | ||
302 | acpi_tb_set_table_loaded_flag(i, FALSE); | ||
303 | break; | ||
304 | } | ||
305 | |||
306 | (void)acpi_ut_release_mutex(ACPI_MTX_INTERPRETER); | ||
307 | return_ACPI_STATUS(status); | ||
308 | } | ||
309 | |||
310 | ACPI_EXPORT_SYMBOL(acpi_unload_table_id) | ||
311 | |||
312 | /******************************************************************************* | ||
313 | * | ||
314 | * FUNCTION: acpi_get_table_with_size | 268 | * FUNCTION: acpi_get_table_with_size |
315 | * | 269 | * |
316 | * PARAMETERS: signature - ACPI signature of needed table | 270 | * PARAMETERS: signature - ACPI signature of needed table |