aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica/exfield.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/acpica/exfield.c')
-rw-r--r--drivers/acpi/acpica/exfield.c29
1 files changed, 13 insertions, 16 deletions
diff --git a/drivers/acpi/acpica/exfield.c b/drivers/acpi/acpica/exfield.c
index a352d0233857..546dcdd86785 100644
--- a/drivers/acpi/acpica/exfield.c
+++ b/drivers/acpi/acpica/exfield.c
@@ -84,7 +84,7 @@ acpi_ex_read_data_from_field(struct acpi_walk_state *walk_state,
84 return_ACPI_STATUS(AE_BAD_PARAMETER); 84 return_ACPI_STATUS(AE_BAD_PARAMETER);
85 } 85 }
86 86
87 if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_BUFFER_FIELD) { 87 if (obj_desc->common.type == ACPI_TYPE_BUFFER_FIELD) {
88 /* 88 /*
89 * If the buffer_field arguments have not been previously evaluated, 89 * If the buffer_field arguments have not been previously evaluated,
90 * evaluate them now and save the results. 90 * evaluate them now and save the results.
@@ -95,9 +95,8 @@ acpi_ex_read_data_from_field(struct acpi_walk_state *walk_state,
95 return_ACPI_STATUS(status); 95 return_ACPI_STATUS(status);
96 } 96 }
97 } 97 }
98 } else 98 } else if ((obj_desc->common.type == ACPI_TYPE_LOCAL_REGION_FIELD) &&
99 if ((ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_LOCAL_REGION_FIELD) 99 (obj_desc->field.region_obj->region.space_id ==
100 && (obj_desc->field.region_obj->region.space_id ==
101 ACPI_ADR_SPACE_SMBUS)) { 100 ACPI_ADR_SPACE_SMBUS)) {
102 /* 101 /*
103 * This is an SMBus read. We must create a buffer to hold the data 102 * This is an SMBus read. We must create a buffer to hold the data
@@ -163,7 +162,7 @@ acpi_ex_read_data_from_field(struct acpi_walk_state *walk_state,
163 162
164 ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, 163 ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
165 "FieldRead [TO]: Obj %p, Type %X, Buf %p, ByteLen %X\n", 164 "FieldRead [TO]: Obj %p, Type %X, Buf %p, ByteLen %X\n",
166 obj_desc, ACPI_GET_OBJECT_TYPE(obj_desc), buffer, 165 obj_desc, obj_desc->common.type, buffer,
167 (u32) length)); 166 (u32) length));
168 ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, 167 ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
169 "FieldRead [FROM]: BitLen %X, BitOff %X, ByteOff %X\n", 168 "FieldRead [FROM]: BitLen %X, BitOff %X, ByteOff %X\n",
@@ -222,7 +221,7 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
222 return_ACPI_STATUS(AE_AML_NO_OPERAND); 221 return_ACPI_STATUS(AE_AML_NO_OPERAND);
223 } 222 }
224 223
225 if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_BUFFER_FIELD) { 224 if (obj_desc->common.type == ACPI_TYPE_BUFFER_FIELD) {
226 /* 225 /*
227 * If the buffer_field arguments have not been previously evaluated, 226 * If the buffer_field arguments have not been previously evaluated,
228 * evaluate them now and save the results. 227 * evaluate them now and save the results.
@@ -233,9 +232,8 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
233 return_ACPI_STATUS(status); 232 return_ACPI_STATUS(status);
234 } 233 }
235 } 234 }
236 } else 235 } else if ((obj_desc->common.type == ACPI_TYPE_LOCAL_REGION_FIELD) &&
237 if ((ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_LOCAL_REGION_FIELD) 236 (obj_desc->field.region_obj->region.space_id ==
238 && (obj_desc->field.region_obj->region.space_id ==
239 ACPI_ADR_SPACE_SMBUS)) { 237 ACPI_ADR_SPACE_SMBUS)) {
240 /* 238 /*
241 * This is an SMBus write. We will bypass the entire field mechanism 239 * This is an SMBus write. We will bypass the entire field mechanism
@@ -243,7 +241,7 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
243 * 241 *
244 * Source must be a buffer of sufficient size (ACPI_SMBUS_BUFFER_SIZE). 242 * Source must be a buffer of sufficient size (ACPI_SMBUS_BUFFER_SIZE).
245 */ 243 */
246 if (ACPI_GET_OBJECT_TYPE(source_desc) != ACPI_TYPE_BUFFER) { 244 if (source_desc->common.type != ACPI_TYPE_BUFFER) {
247 ACPI_ERROR((AE_INFO, 245 ACPI_ERROR((AE_INFO,
248 "SMBus write requires Buffer, found type %s", 246 "SMBus write requires Buffer, found type %s",
249 acpi_ut_get_object_type_name(source_desc))); 247 acpi_ut_get_object_type_name(source_desc)));
@@ -291,7 +289,7 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
291 289
292 /* Get a pointer to the data to be written */ 290 /* Get a pointer to the data to be written */
293 291
294 switch (ACPI_GET_OBJECT_TYPE(source_desc)) { 292 switch (source_desc->common.type) {
295 case ACPI_TYPE_INTEGER: 293 case ACPI_TYPE_INTEGER:
296 buffer = &source_desc->integer.value; 294 buffer = &source_desc->integer.value;
297 length = sizeof(source_desc->integer.value); 295 length = sizeof(source_desc->integer.value);
@@ -314,15 +312,14 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc,
314 ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, 312 ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
315 "FieldWrite [FROM]: Obj %p (%s:%X), Buf %p, ByteLen %X\n", 313 "FieldWrite [FROM]: Obj %p (%s:%X), Buf %p, ByteLen %X\n",
316 source_desc, 314 source_desc,
317 acpi_ut_get_type_name(ACPI_GET_OBJECT_TYPE 315 acpi_ut_get_type_name(source_desc->common.type),
318 (source_desc)), 316 source_desc->common.type, buffer, length));
319 ACPI_GET_OBJECT_TYPE(source_desc), buffer, length));
320 317
321 ACPI_DEBUG_PRINT((ACPI_DB_BFIELD, 318 ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
322 "FieldWrite [TO]: Obj %p (%s:%X), BitLen %X, BitOff %X, ByteOff %X\n", 319 "FieldWrite [TO]: Obj %p (%s:%X), BitLen %X, BitOff %X, ByteOff %X\n",
323 obj_desc, 320 obj_desc,
324 acpi_ut_get_type_name(ACPI_GET_OBJECT_TYPE(obj_desc)), 321 acpi_ut_get_type_name(obj_desc->common.type),
325 ACPI_GET_OBJECT_TYPE(obj_desc), 322 obj_desc->common.type,
326 obj_desc->common_field.bit_length, 323 obj_desc->common_field.bit_length,
327 obj_desc->common_field.start_field_bit_offset, 324 obj_desc->common_field.start_field_bit_offset,
328 obj_desc->common_field.base_byte_offset)); 325 obj_desc->common_field.base_byte_offset));