diff options
Diffstat (limited to 'drivers/acpi/acpica/dsfield.c')
-rw-r--r-- | drivers/acpi/acpica/dsfield.c | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/drivers/acpi/acpica/dsfield.c b/drivers/acpi/acpica/dsfield.c index 37e11a31bd52..6bca0ec42dbd 100644 --- a/drivers/acpi/acpica/dsfield.c +++ b/drivers/acpi/acpica/dsfield.c | |||
@@ -106,6 +106,7 @@ acpi_ds_create_external_region(acpi_status lookup_status, | |||
106 | * insert the name into the namespace. | 106 | * insert the name into the namespace. |
107 | */ | 107 | */ |
108 | acpi_dm_add_op_to_external_list(op, path, ACPI_TYPE_REGION, 0, 0); | 108 | acpi_dm_add_op_to_external_list(op, path, ACPI_TYPE_REGION, 0, 0); |
109 | |||
109 | status = acpi_ns_lookup(walk_state->scope_info, path, ACPI_TYPE_REGION, | 110 | status = acpi_ns_lookup(walk_state->scope_info, path, ACPI_TYPE_REGION, |
110 | ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT, | 111 | ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT, |
111 | walk_state, node); | 112 | walk_state, node); |
@@ -202,11 +203,10 @@ acpi_ds_create_buffer_field(union acpi_parse_object *op, | |||
202 | 203 | ||
203 | /* Enter the name_string into the namespace */ | 204 | /* Enter the name_string into the namespace */ |
204 | 205 | ||
205 | status = | 206 | status = acpi_ns_lookup(walk_state->scope_info, |
206 | acpi_ns_lookup(walk_state->scope_info, | 207 | arg->common.value.string, ACPI_TYPE_ANY, |
207 | arg->common.value.string, ACPI_TYPE_ANY, | 208 | ACPI_IMODE_LOAD_PASS1, flags, |
208 | ACPI_IMODE_LOAD_PASS1, flags, walk_state, | 209 | walk_state, &node); |
209 | &node); | ||
210 | if (ACPI_FAILURE(status)) { | 210 | if (ACPI_FAILURE(status)) { |
211 | ACPI_ERROR_NAMESPACE(arg->common.value.string, status); | 211 | ACPI_ERROR_NAMESPACE(arg->common.value.string, status); |
212 | return_ACPI_STATUS(status); | 212 | return_ACPI_STATUS(status); |
@@ -244,8 +244,8 @@ acpi_ds_create_buffer_field(union acpi_parse_object *op, | |||
244 | } | 244 | } |
245 | 245 | ||
246 | /* | 246 | /* |
247 | * Remember location in AML stream of the field unit opcode and operands -- | 247 | * Remember location in AML stream of the field unit opcode and operands |
248 | * since the buffer and index operands must be evaluated. | 248 | * -- since the buffer and index operands must be evaluated. |
249 | */ | 249 | */ |
250 | second_desc = obj_desc->common.next_object; | 250 | second_desc = obj_desc->common.next_object; |
251 | second_desc->extra.aml_start = op->named.data; | 251 | second_desc->extra.aml_start = op->named.data; |
@@ -310,8 +310,8 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info, | |||
310 | switch (arg->common.aml_opcode) { | 310 | switch (arg->common.aml_opcode) { |
311 | case AML_INT_RESERVEDFIELD_OP: | 311 | case AML_INT_RESERVEDFIELD_OP: |
312 | 312 | ||
313 | position = (u64)info->field_bit_position | 313 | position = (u64)info->field_bit_position + |
314 | + (u64)arg->common.value.size; | 314 | (u64)arg->common.value.size; |
315 | 315 | ||
316 | if (position > ACPI_UINT32_MAX) { | 316 | if (position > ACPI_UINT32_MAX) { |
317 | ACPI_ERROR((AE_INFO, | 317 | ACPI_ERROR((AE_INFO, |
@@ -344,13 +344,13 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info, | |||
344 | 344 | ||
345 | /* access_attribute (attrib_quick, attrib_byte, etc.) */ | 345 | /* access_attribute (attrib_quick, attrib_byte, etc.) */ |
346 | 346 | ||
347 | info->attribute = | 347 | info->attribute = (u8) |
348 | (u8)((arg->common.value.integer >> 8) & 0xFF); | 348 | ((arg->common.value.integer >> 8) & 0xFF); |
349 | 349 | ||
350 | /* access_length (for serial/buffer protocols) */ | 350 | /* access_length (for serial/buffer protocols) */ |
351 | 351 | ||
352 | info->access_length = | 352 | info->access_length = (u8) |
353 | (u8)((arg->common.value.integer >> 16) & 0xFF); | 353 | ((arg->common.value.integer >> 16) & 0xFF); |
354 | break; | 354 | break; |
355 | 355 | ||
356 | case AML_INT_CONNECTION_OP: | 356 | case AML_INT_CONNECTION_OP: |
@@ -425,8 +425,8 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info, | |||
425 | 425 | ||
426 | /* Keep track of bit position for the next field */ | 426 | /* Keep track of bit position for the next field */ |
427 | 427 | ||
428 | position = (u64)info->field_bit_position | 428 | position = (u64)info->field_bit_position + |
429 | + (u64)arg->common.value.size; | 429 | (u64)arg->common.value.size; |
430 | 430 | ||
431 | if (position > ACPI_UINT32_MAX) { | 431 | if (position > ACPI_UINT32_MAX) { |
432 | ACPI_ERROR((AE_INFO, | 432 | ACPI_ERROR((AE_INFO, |
@@ -716,11 +716,12 @@ acpi_ds_create_bank_field(union acpi_parse_object *op, | |||
716 | 716 | ||
717 | /* | 717 | /* |
718 | * Use Info.data_register_node to store bank_field Op | 718 | * Use Info.data_register_node to store bank_field Op |
719 | * It's safe because data_register_node will never be used when create bank field | 719 | * It's safe because data_register_node will never be used when create |
720 | * We store aml_start and aml_length in the bank_field Op for late evaluation | 720 | * bank field \we store aml_start and aml_length in the bank_field Op for |
721 | * Used in acpi_ex_prep_field_value(Info) | 721 | * late evaluation. Used in acpi_ex_prep_field_value(Info) |
722 | * | 722 | * |
723 | * TBD: Or, should we add a field in struct acpi_create_field_info, like "void *ParentOp"? | 723 | * TBD: Or, should we add a field in struct acpi_create_field_info, like |
724 | * "void *ParentOp"? | ||
724 | */ | 725 | */ |
725 | info.data_register_node = (struct acpi_namespace_node *)op; | 726 | info.data_register_node = (struct acpi_namespace_node *)op; |
726 | 727 | ||