summaryrefslogtreecommitdiff
path: root/drivers/acpi/acpica/exoparg1.c
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2017-06-05 11:41:18 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-06-27 23:25:22 +0300
commit1d6e9cfa5a476e867c5571bce24aa5ce167896a8 (patch)
tree3c60e6e5a4c90fd80d25c723dae61306ec52dc12 /drivers/acpi/acpica/exoparg1.c
parentc6915b3f29eb0911997efbf05b815a4e2b7ec1d0 (diff)
downloadlinux-1d6e9cfa5a476e867c5571bce24aa5ce167896a8.tar.xz
ACPICA: Fix for Device/Thermal objects with ObjectType and DerefOf
ACPICA commit 89565151aa4db7b546d4935b187bf2c4a86885ee These types must be special cased because the namespace node does not contain a subobject as do all other types. Link: https://github.com/acpica/acpica/commit/89565151 Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/acpica/exoparg1.c')
-rw-r--r--drivers/acpi/acpica/exoparg1.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/drivers/acpi/acpica/exoparg1.c b/drivers/acpi/acpica/exoparg1.c
index e327349675cd..f787651348c1 100644
--- a/drivers/acpi/acpica/exoparg1.c
+++ b/drivers/acpi/acpica/exoparg1.c
@@ -921,13 +921,26 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state)
* This is a deref_of (object_reference)
* Get the actual object from the Node (This is the dereference).
* This case may only happen when a local_x or arg_x is
- * dereferenced above.
+ * dereferenced above, or for references to device and
+ * thermal objects.
*/
- return_desc = acpi_ns_get_attached_object((struct
- acpi_namespace_node
- *)
- operand[0]);
- acpi_ut_add_reference(return_desc);
+ switch (((struct acpi_namespace_node *)operand[0])->
+ type) {
+ case ACPI_TYPE_DEVICE:
+ case ACPI_TYPE_THERMAL:
+
+ /* These types have no node subobject, return the NS node */
+
+ return_desc = operand[0];
+ break;
+
+ default:
+ /* For most types, get the object attached to the node */
+
+ return_desc = acpi_ns_get_attached_object((struct acpi_namespace_node *)operand[0]);
+ acpi_ut_add_reference(return_desc);
+ break;
+ }
} else {
/*
* This must be a reference object produced by either the