aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/dispatcher/dsfield.c
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2005-08-05 00:44:28 -0400
committerLen Brown <len.brown@intel.com>2005-08-05 00:45:14 -0400
commit4be44fcd3bf648b782f4460fd06dfae6c42ded4b (patch)
tree5b5b7d296ea58786f53b95e5eac9565ff66890b0 /drivers/acpi/dispatcher/dsfield.c
parentc65ade4dc8b486e8c8b9b0a6399789a5428e2039 (diff)
[ACPI] Lindent all ACPI files
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/dispatcher/dsfield.c')
-rw-r--r--drivers/acpi/dispatcher/dsfield.c346
1 files changed, 161 insertions, 185 deletions
diff --git a/drivers/acpi/dispatcher/dsfield.c b/drivers/acpi/dispatcher/dsfield.c
index 84193983d6ba..2022aeaecfbb 100644
--- a/drivers/acpi/dispatcher/dsfield.c
+++ b/drivers/acpi/dispatcher/dsfield.c
@@ -41,7 +41,6 @@
41 * POSSIBILITY OF SUCH DAMAGES. 41 * POSSIBILITY OF SUCH DAMAGES.
42 */ 42 */
43 43
44
45#include <acpi/acpi.h> 44#include <acpi/acpi.h>
46#include <acpi/amlcode.h> 45#include <acpi/amlcode.h>
47#include <acpi/acdispat.h> 46#include <acpi/acdispat.h>
@@ -49,18 +48,14 @@
49#include <acpi/acnamesp.h> 48#include <acpi/acnamesp.h>
50#include <acpi/acparser.h> 49#include <acpi/acparser.h>
51 50
52
53#define _COMPONENT ACPI_DISPATCHER 51#define _COMPONENT ACPI_DISPATCHER
54 ACPI_MODULE_NAME ("dsfield") 52ACPI_MODULE_NAME("dsfield")
55 53
56/* Local prototypes */ 54/* Local prototypes */
57
58static acpi_status 55static acpi_status
59acpi_ds_get_field_names ( 56acpi_ds_get_field_names(struct acpi_create_field_info *info,
60 struct acpi_create_field_info *info, 57 struct acpi_walk_state *walk_state,
61 struct acpi_walk_state *walk_state, 58 union acpi_parse_object *arg);
62 union acpi_parse_object *arg);
63
64 59
65/******************************************************************************* 60/*******************************************************************************
66 * 61 *
@@ -82,41 +77,36 @@ acpi_ds_get_field_names (
82 ******************************************************************************/ 77 ******************************************************************************/
83 78
84acpi_status 79acpi_status
85acpi_ds_create_buffer_field ( 80acpi_ds_create_buffer_field(union acpi_parse_object *op,
86 union acpi_parse_object *op, 81 struct acpi_walk_state *walk_state)
87 struct acpi_walk_state *walk_state)
88{ 82{
89 union acpi_parse_object *arg; 83 union acpi_parse_object *arg;
90 struct acpi_namespace_node *node; 84 struct acpi_namespace_node *node;
91 acpi_status status; 85 acpi_status status;
92 union acpi_operand_object *obj_desc; 86 union acpi_operand_object *obj_desc;
93 union acpi_operand_object *second_desc = NULL; 87 union acpi_operand_object *second_desc = NULL;
94 u32 flags; 88 u32 flags;
95
96
97 ACPI_FUNCTION_TRACE ("ds_create_buffer_field");
98 89
90 ACPI_FUNCTION_TRACE("ds_create_buffer_field");
99 91
100 /* Get the name_string argument */ 92 /* Get the name_string argument */
101 93
102 if (op->common.aml_opcode == AML_CREATE_FIELD_OP) { 94 if (op->common.aml_opcode == AML_CREATE_FIELD_OP) {
103 arg = acpi_ps_get_arg (op, 3); 95 arg = acpi_ps_get_arg(op, 3);
104 } 96 } else {
105 else {
106 /* Create Bit/Byte/Word/Dword field */ 97 /* Create Bit/Byte/Word/Dword field */
107 98
108 arg = acpi_ps_get_arg (op, 2); 99 arg = acpi_ps_get_arg(op, 2);
109 } 100 }
110 101
111 if (!arg) { 102 if (!arg) {
112 return_ACPI_STATUS (AE_AML_NO_OPERAND); 103 return_ACPI_STATUS(AE_AML_NO_OPERAND);
113 } 104 }
114 105
115 if (walk_state->deferred_node) { 106 if (walk_state->deferred_node) {
116 node = walk_state->deferred_node; 107 node = walk_state->deferred_node;
117 status = AE_OK; 108 status = AE_OK;
118 } 109 } else {
119 else {
120 /* 110 /*
121 * During the load phase, we want to enter the name of the field into 111 * During the load phase, we want to enter the name of the field into
122 * the namespace. During the execute phase (when we evaluate the size 112 * the namespace. During the execute phase (when we evaluate the size
@@ -124,21 +114,22 @@ acpi_ds_create_buffer_field (
124 */ 114 */
125 if (walk_state->parse_flags & ACPI_PARSE_EXECUTE) { 115 if (walk_state->parse_flags & ACPI_PARSE_EXECUTE) {
126 flags = ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE; 116 flags = ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE;
127 } 117 } else {
128 else {
129 flags = ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE | 118 flags = ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE |
130 ACPI_NS_ERROR_IF_FOUND; 119 ACPI_NS_ERROR_IF_FOUND;
131 } 120 }
132 121
133 /* 122 /*
134 * Enter the name_string into the namespace 123 * Enter the name_string into the namespace
135 */ 124 */
136 status = acpi_ns_lookup (walk_state->scope_info, arg->common.value.string, 125 status =
137 ACPI_TYPE_ANY, ACPI_IMODE_LOAD_PASS1, 126 acpi_ns_lookup(walk_state->scope_info,
138 flags, walk_state, &(node)); 127 arg->common.value.string, ACPI_TYPE_ANY,
139 if (ACPI_FAILURE (status)) { 128 ACPI_IMODE_LOAD_PASS1, flags, walk_state,
140 ACPI_REPORT_NSERROR (arg->common.value.string, status); 129 &(node));
141 return_ACPI_STATUS (status); 130 if (ACPI_FAILURE(status)) {
131 ACPI_REPORT_NSERROR(arg->common.value.string, status);
132 return_ACPI_STATUS(status);
142 } 133 }
143 } 134 }
144 135
@@ -153,9 +144,9 @@ acpi_ds_create_buffer_field (
153 * and we need to create the field object. Otherwise, this was a lookup 144 * and we need to create the field object. Otherwise, this was a lookup
154 * of an existing node and we don't want to create the field object again. 145 * of an existing node and we don't want to create the field object again.
155 */ 146 */
156 obj_desc = acpi_ns_get_attached_object (node); 147 obj_desc = acpi_ns_get_attached_object(node);
157 if (obj_desc) { 148 if (obj_desc) {
158 return_ACPI_STATUS (AE_OK); 149 return_ACPI_STATUS(AE_OK);
159 } 150 }
160 151
161 /* 152 /*
@@ -165,7 +156,7 @@ acpi_ds_create_buffer_field (
165 156
166 /* Create the buffer field object */ 157 /* Create the buffer field object */
167 158
168 obj_desc = acpi_ut_create_internal_object (ACPI_TYPE_BUFFER_FIELD); 159 obj_desc = acpi_ut_create_internal_object(ACPI_TYPE_BUFFER_FIELD);
169 if (!obj_desc) { 160 if (!obj_desc) {
170 status = AE_NO_MEMORY; 161 status = AE_NO_MEMORY;
171 goto cleanup; 162 goto cleanup;
@@ -176,28 +167,26 @@ acpi_ds_create_buffer_field (
176 * opcode and operands -- since the buffer and index 167 * opcode and operands -- since the buffer and index
177 * operands must be evaluated. 168 * operands must be evaluated.
178 */ 169 */
179 second_desc = obj_desc->common.next_object; 170 second_desc = obj_desc->common.next_object;
180 second_desc->extra.aml_start = op->named.data; 171 second_desc->extra.aml_start = op->named.data;
181 second_desc->extra.aml_length = op->named.length; 172 second_desc->extra.aml_length = op->named.length;
182 obj_desc->buffer_field.node = node; 173 obj_desc->buffer_field.node = node;
183 174
184 /* Attach constructed field descriptors to parent node */ 175 /* Attach constructed field descriptors to parent node */
185 176
186 status = acpi_ns_attach_object (node, obj_desc, ACPI_TYPE_BUFFER_FIELD); 177 status = acpi_ns_attach_object(node, obj_desc, ACPI_TYPE_BUFFER_FIELD);
187 if (ACPI_FAILURE (status)) { 178 if (ACPI_FAILURE(status)) {
188 goto cleanup; 179 goto cleanup;
189 } 180 }
190 181
191 182 cleanup:
192cleanup:
193 183
194 /* Remove local reference to the object */ 184 /* Remove local reference to the object */
195 185
196 acpi_ut_remove_reference (obj_desc); 186 acpi_ut_remove_reference(obj_desc);
197 return_ACPI_STATUS (status); 187 return_ACPI_STATUS(status);
198} 188}
199 189
200
201/******************************************************************************* 190/*******************************************************************************
202 * 191 *
203 * FUNCTION: acpi_ds_get_field_names 192 * FUNCTION: acpi_ds_get_field_names
@@ -214,17 +203,14 @@ cleanup:
214 ******************************************************************************/ 203 ******************************************************************************/
215 204
216static acpi_status 205static acpi_status
217acpi_ds_get_field_names ( 206acpi_ds_get_field_names(struct acpi_create_field_info *info,
218 struct acpi_create_field_info *info, 207 struct acpi_walk_state *walk_state,
219 struct acpi_walk_state *walk_state, 208 union acpi_parse_object *arg)
220 union acpi_parse_object *arg)
221{ 209{
222 acpi_status status; 210 acpi_status status;
223 acpi_integer position; 211 acpi_integer position;
224
225
226 ACPI_FUNCTION_TRACE_PTR ("ds_get_field_names", info);
227 212
213 ACPI_FUNCTION_TRACE_PTR("ds_get_field_names", info);
228 214
229 /* First field starts at bit zero */ 215 /* First field starts at bit zero */
230 216
@@ -243,18 +229,16 @@ acpi_ds_get_field_names (
243 case AML_INT_RESERVEDFIELD_OP: 229 case AML_INT_RESERVEDFIELD_OP:
244 230
245 position = (acpi_integer) info->field_bit_position 231 position = (acpi_integer) info->field_bit_position
246 + (acpi_integer) arg->common.value.size; 232 + (acpi_integer) arg->common.value.size;
247 233
248 if (position > ACPI_UINT32_MAX) { 234 if (position > ACPI_UINT32_MAX) {
249 ACPI_REPORT_ERROR (( 235 ACPI_REPORT_ERROR(("Bit offset within field too large (> 0xFFFFFFFF)\n"));
250 "Bit offset within field too large (> 0xFFFFFFFF)\n")); 236 return_ACPI_STATUS(AE_SUPPORT);
251 return_ACPI_STATUS (AE_SUPPORT);
252 } 237 }
253 238
254 info->field_bit_position = (u32) position; 239 info->field_bit_position = (u32) position;
255 break; 240 break;
256 241
257
258 case AML_INT_ACCESSFIELD_OP: 242 case AML_INT_ACCESSFIELD_OP:
259 243
260 /* 244 /*
@@ -266,73 +250,70 @@ acpi_ds_get_field_names (
266 * ACCESS_TYPE bits 250 * ACCESS_TYPE bits
267 */ 251 */
268 info->field_flags = (u8) 252 info->field_flags = (u8)
269 ((info->field_flags & ~(AML_FIELD_ACCESS_TYPE_MASK)) | 253 ((info->
270 ((u8) ((u32) arg->common.value.integer >> 8))); 254 field_flags & ~(AML_FIELD_ACCESS_TYPE_MASK)) |
255 ((u8) ((u32) arg->common.value.integer >> 8)));
271 256
272 info->attribute = (u8) (arg->common.value.integer); 257 info->attribute = (u8) (arg->common.value.integer);
273 break; 258 break;
274 259
275
276 case AML_INT_NAMEDFIELD_OP: 260 case AML_INT_NAMEDFIELD_OP:
277 261
278 /* Lookup the name */ 262 /* Lookup the name */
279 263
280 status = acpi_ns_lookup (walk_state->scope_info, 264 status = acpi_ns_lookup(walk_state->scope_info,
281 (char *) &arg->named.name, 265 (char *)&arg->named.name,
282 info->field_type, ACPI_IMODE_EXECUTE, 266 info->field_type,
283 ACPI_NS_DONT_OPEN_SCOPE, 267 ACPI_IMODE_EXECUTE,
284 walk_state, &info->field_node); 268 ACPI_NS_DONT_OPEN_SCOPE,
285 if (ACPI_FAILURE (status)) { 269 walk_state, &info->field_node);
286 ACPI_REPORT_NSERROR ((char *) &arg->named.name, status); 270 if (ACPI_FAILURE(status)) {
271 ACPI_REPORT_NSERROR((char *)&arg->named.name,
272 status);
287 if (status != AE_ALREADY_EXISTS) { 273 if (status != AE_ALREADY_EXISTS) {
288 return_ACPI_STATUS (status); 274 return_ACPI_STATUS(status);
289 } 275 }
290 276
291 /* Already exists, ignore error */ 277 /* Already exists, ignore error */
292 } 278 } else {
293 else {
294 arg->common.node = info->field_node; 279 arg->common.node = info->field_node;
295 info->field_bit_length = arg->common.value.size; 280 info->field_bit_length = arg->common.value.size;
296 281
297 /* Create and initialize an object for the new Field Node */ 282 /* Create and initialize an object for the new Field Node */
298 283
299 status = acpi_ex_prep_field_value (info); 284 status = acpi_ex_prep_field_value(info);
300 if (ACPI_FAILURE (status)) { 285 if (ACPI_FAILURE(status)) {
301 return_ACPI_STATUS (status); 286 return_ACPI_STATUS(status);
302 } 287 }
303 } 288 }
304 289
305 /* Keep track of bit position for the next field */ 290 /* Keep track of bit position for the next field */
306 291
307 position = (acpi_integer) info->field_bit_position 292 position = (acpi_integer) info->field_bit_position
308 + (acpi_integer) arg->common.value.size; 293 + (acpi_integer) arg->common.value.size;
309 294
310 if (position > ACPI_UINT32_MAX) { 295 if (position > ACPI_UINT32_MAX) {
311 ACPI_REPORT_ERROR (( 296 ACPI_REPORT_ERROR(("Field [%4.4s] bit offset too large (> 0xFFFFFFFF)\n", (char *)&info->field_node->name));
312 "Field [%4.4s] bit offset too large (> 0xFFFFFFFF)\n", 297 return_ACPI_STATUS(AE_SUPPORT);
313 (char *) &info->field_node->name));
314 return_ACPI_STATUS (AE_SUPPORT);
315 } 298 }
316 299
317 info->field_bit_position += info->field_bit_length; 300 info->field_bit_position += info->field_bit_length;
318 break; 301 break;
319 302
320
321 default: 303 default:
322 304
323 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, 305 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
324 "Invalid opcode in field list: %X\n", 306 "Invalid opcode in field list: %X\n",
325 arg->common.aml_opcode)); 307 arg->common.aml_opcode));
326 return_ACPI_STATUS (AE_AML_BAD_OPCODE); 308 return_ACPI_STATUS(AE_AML_BAD_OPCODE);
327 } 309 }
328 310
329 arg = arg->common.next; 311 arg = arg->common.next;
330 } 312 }
331 313
332 return_ACPI_STATUS (AE_OK); 314 return_ACPI_STATUS(AE_OK);
333} 315}
334 316
335
336/******************************************************************************* 317/*******************************************************************************
337 * 318 *
338 * FUNCTION: acpi_ds_create_field 319 * FUNCTION: acpi_ds_create_field
@@ -348,29 +329,28 @@ acpi_ds_get_field_names (
348 ******************************************************************************/ 329 ******************************************************************************/
349 330
350acpi_status 331acpi_status
351acpi_ds_create_field ( 332acpi_ds_create_field(union acpi_parse_object *op,
352 union acpi_parse_object *op, 333 struct acpi_namespace_node *region_node,
353 struct acpi_namespace_node *region_node, 334 struct acpi_walk_state *walk_state)
354 struct acpi_walk_state *walk_state)
355{ 335{
356 acpi_status status; 336 acpi_status status;
357 union acpi_parse_object *arg; 337 union acpi_parse_object *arg;
358 struct acpi_create_field_info info; 338 struct acpi_create_field_info info;
359
360
361 ACPI_FUNCTION_TRACE_PTR ("ds_create_field", op);
362 339
340 ACPI_FUNCTION_TRACE_PTR("ds_create_field", op);
363 341
364 /* First arg is the name of the parent op_region (must already exist) */ 342 /* First arg is the name of the parent op_region (must already exist) */
365 343
366 arg = op->common.value.arg; 344 arg = op->common.value.arg;
367 if (!region_node) { 345 if (!region_node) {
368 status = acpi_ns_lookup (walk_state->scope_info, arg->common.value.name, 346 status =
369 ACPI_TYPE_REGION, ACPI_IMODE_EXECUTE, 347 acpi_ns_lookup(walk_state->scope_info,
370 ACPI_NS_SEARCH_PARENT, walk_state, &region_node); 348 arg->common.value.name, ACPI_TYPE_REGION,
371 if (ACPI_FAILURE (status)) { 349 ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT,
372 ACPI_REPORT_NSERROR (arg->common.value.name, status); 350 walk_state, &region_node);
373 return_ACPI_STATUS (status); 351 if (ACPI_FAILURE(status)) {
352 ACPI_REPORT_NSERROR(arg->common.value.name, status);
353 return_ACPI_STATUS(status);
374 } 354 }
375 } 355 }
376 356
@@ -385,12 +365,11 @@ acpi_ds_create_field (
385 info.field_type = ACPI_TYPE_LOCAL_REGION_FIELD; 365 info.field_type = ACPI_TYPE_LOCAL_REGION_FIELD;
386 info.region_node = region_node; 366 info.region_node = region_node;
387 367
388 status = acpi_ds_get_field_names (&info, walk_state, arg->common.next); 368 status = acpi_ds_get_field_names(&info, walk_state, arg->common.next);
389 369
390 return_ACPI_STATUS (status); 370 return_ACPI_STATUS(status);
391} 371}
392 372
393
394/******************************************************************************* 373/*******************************************************************************
395 * 374 *
396 * FUNCTION: acpi_ds_init_field_objects 375 * FUNCTION: acpi_ds_init_field_objects
@@ -407,37 +386,34 @@ acpi_ds_create_field (
407 ******************************************************************************/ 386 ******************************************************************************/
408 387
409acpi_status 388acpi_status
410acpi_ds_init_field_objects ( 389acpi_ds_init_field_objects(union acpi_parse_object *op,
411 union acpi_parse_object *op, 390 struct acpi_walk_state *walk_state)
412 struct acpi_walk_state *walk_state)
413{ 391{
414 acpi_status status; 392 acpi_status status;
415 union acpi_parse_object *arg = NULL; 393 union acpi_parse_object *arg = NULL;
416 struct acpi_namespace_node *node; 394 struct acpi_namespace_node *node;
417 u8 type = 0; 395 u8 type = 0;
418
419
420 ACPI_FUNCTION_TRACE_PTR ("ds_init_field_objects", op);
421 396
397 ACPI_FUNCTION_TRACE_PTR("ds_init_field_objects", op);
422 398
423 switch (walk_state->opcode) { 399 switch (walk_state->opcode) {
424 case AML_FIELD_OP: 400 case AML_FIELD_OP:
425 arg = acpi_ps_get_arg (op, 2); 401 arg = acpi_ps_get_arg(op, 2);
426 type = ACPI_TYPE_LOCAL_REGION_FIELD; 402 type = ACPI_TYPE_LOCAL_REGION_FIELD;
427 break; 403 break;
428 404
429 case AML_BANK_FIELD_OP: 405 case AML_BANK_FIELD_OP:
430 arg = acpi_ps_get_arg (op, 4); 406 arg = acpi_ps_get_arg(op, 4);
431 type = ACPI_TYPE_LOCAL_BANK_FIELD; 407 type = ACPI_TYPE_LOCAL_BANK_FIELD;
432 break; 408 break;
433 409
434 case AML_INDEX_FIELD_OP: 410 case AML_INDEX_FIELD_OP:
435 arg = acpi_ps_get_arg (op, 3); 411 arg = acpi_ps_get_arg(op, 3);
436 type = ACPI_TYPE_LOCAL_INDEX_FIELD; 412 type = ACPI_TYPE_LOCAL_INDEX_FIELD;
437 break; 413 break;
438 414
439 default: 415 default:
440 return_ACPI_STATUS (AE_BAD_PARAMETER); 416 return_ACPI_STATUS(AE_BAD_PARAMETER);
441 } 417 }
442 418
443 /* 419 /*
@@ -447,16 +423,18 @@ acpi_ds_init_field_objects (
447 /* Ignore OFFSET and ACCESSAS terms here */ 423 /* Ignore OFFSET and ACCESSAS terms here */
448 424
449 if (arg->common.aml_opcode == AML_INT_NAMEDFIELD_OP) { 425 if (arg->common.aml_opcode == AML_INT_NAMEDFIELD_OP) {
450 status = acpi_ns_lookup (walk_state->scope_info, 426 status = acpi_ns_lookup(walk_state->scope_info,
451 (char *) &arg->named.name, 427 (char *)&arg->named.name,
452 type, ACPI_IMODE_LOAD_PASS1, 428 type, ACPI_IMODE_LOAD_PASS1,
453 ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE | 429 ACPI_NS_NO_UPSEARCH |
454 ACPI_NS_ERROR_IF_FOUND, 430 ACPI_NS_DONT_OPEN_SCOPE |
455 walk_state, &node); 431 ACPI_NS_ERROR_IF_FOUND,
456 if (ACPI_FAILURE (status)) { 432 walk_state, &node);
457 ACPI_REPORT_NSERROR ((char *) &arg->named.name, status); 433 if (ACPI_FAILURE(status)) {
434 ACPI_REPORT_NSERROR((char *)&arg->named.name,
435 status);
458 if (status != AE_ALREADY_EXISTS) { 436 if (status != AE_ALREADY_EXISTS) {
459 return_ACPI_STATUS (status); 437 return_ACPI_STATUS(status);
460 } 438 }
461 439
462 /* Name already exists, just ignore this error */ 440 /* Name already exists, just ignore this error */
@@ -472,10 +450,9 @@ acpi_ds_init_field_objects (
472 arg = arg->common.next; 450 arg = arg->common.next;
473 } 451 }
474 452
475 return_ACPI_STATUS (AE_OK); 453 return_ACPI_STATUS(AE_OK);
476} 454}
477 455
478
479/******************************************************************************* 456/*******************************************************************************
480 * 457 *
481 * FUNCTION: acpi_ds_create_bank_field 458 * FUNCTION: acpi_ds_create_bank_field
@@ -491,41 +468,42 @@ acpi_ds_init_field_objects (
491 ******************************************************************************/ 468 ******************************************************************************/
492 469
493acpi_status 470acpi_status
494acpi_ds_create_bank_field ( 471acpi_ds_create_bank_field(union acpi_parse_object *op,
495 union acpi_parse_object *op, 472 struct acpi_namespace_node *region_node,
496 struct acpi_namespace_node *region_node, 473 struct acpi_walk_state *walk_state)
497 struct acpi_walk_state *walk_state)
498{ 474{
499 acpi_status status; 475 acpi_status status;
500 union acpi_parse_object *arg; 476 union acpi_parse_object *arg;
501 struct acpi_create_field_info info; 477 struct acpi_create_field_info info;
502
503
504 ACPI_FUNCTION_TRACE_PTR ("ds_create_bank_field", op);
505 478
479 ACPI_FUNCTION_TRACE_PTR("ds_create_bank_field", op);
506 480
507 /* First arg is the name of the parent op_region (must already exist) */ 481 /* First arg is the name of the parent op_region (must already exist) */
508 482
509 arg = op->common.value.arg; 483 arg = op->common.value.arg;
510 if (!region_node) { 484 if (!region_node) {
511 status = acpi_ns_lookup (walk_state->scope_info, arg->common.value.name, 485 status =
512 ACPI_TYPE_REGION, ACPI_IMODE_EXECUTE, 486 acpi_ns_lookup(walk_state->scope_info,
513 ACPI_NS_SEARCH_PARENT, walk_state, &region_node); 487 arg->common.value.name, ACPI_TYPE_REGION,
514 if (ACPI_FAILURE (status)) { 488 ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT,
515 ACPI_REPORT_NSERROR (arg->common.value.name, status); 489 walk_state, &region_node);
516 return_ACPI_STATUS (status); 490 if (ACPI_FAILURE(status)) {
491 ACPI_REPORT_NSERROR(arg->common.value.name, status);
492 return_ACPI_STATUS(status);
517 } 493 }
518 } 494 }
519 495
520 /* Second arg is the Bank Register (Field) (must already exist) */ 496 /* Second arg is the Bank Register (Field) (must already exist) */
521 497
522 arg = arg->common.next; 498 arg = arg->common.next;
523 status = acpi_ns_lookup (walk_state->scope_info, arg->common.value.string, 499 status =
524 ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE, 500 acpi_ns_lookup(walk_state->scope_info, arg->common.value.string,
525 ACPI_NS_SEARCH_PARENT, walk_state, &info.register_node); 501 ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
526 if (ACPI_FAILURE (status)) { 502 ACPI_NS_SEARCH_PARENT, walk_state,
527 ACPI_REPORT_NSERROR (arg->common.value.string, status); 503 &info.register_node);
528 return_ACPI_STATUS (status); 504 if (ACPI_FAILURE(status)) {
505 ACPI_REPORT_NSERROR(arg->common.value.string, status);
506 return_ACPI_STATUS(status);
529 } 507 }
530 508
531 /* Third arg is the bank_value */ 509 /* Third arg is the bank_value */
@@ -543,12 +521,11 @@ acpi_ds_create_bank_field (
543 info.field_type = ACPI_TYPE_LOCAL_BANK_FIELD; 521 info.field_type = ACPI_TYPE_LOCAL_BANK_FIELD;
544 info.region_node = region_node; 522 info.region_node = region_node;
545 523
546 status = acpi_ds_get_field_names (&info, walk_state, arg->common.next); 524 status = acpi_ds_get_field_names(&info, walk_state, arg->common.next);
547 525
548 return_ACPI_STATUS (status); 526 return_ACPI_STATUS(status);
549} 527}
550 528
551
552/******************************************************************************* 529/*******************************************************************************
553 * 530 *
554 * FUNCTION: acpi_ds_create_index_field 531 * FUNCTION: acpi_ds_create_index_field
@@ -564,39 +541,40 @@ acpi_ds_create_bank_field (
564 ******************************************************************************/ 541 ******************************************************************************/
565 542
566acpi_status 543acpi_status
567acpi_ds_create_index_field ( 544acpi_ds_create_index_field(union acpi_parse_object *op,
568 union acpi_parse_object *op, 545 struct acpi_namespace_node *region_node,
569 struct acpi_namespace_node *region_node, 546 struct acpi_walk_state *walk_state)
570 struct acpi_walk_state *walk_state)
571{ 547{
572 acpi_status status; 548 acpi_status status;
573 union acpi_parse_object *arg; 549 union acpi_parse_object *arg;
574 struct acpi_create_field_info info; 550 struct acpi_create_field_info info;
575
576
577 ACPI_FUNCTION_TRACE_PTR ("ds_create_index_field", op);
578 551
552 ACPI_FUNCTION_TRACE_PTR("ds_create_index_field", op);
579 553
580 /* First arg is the name of the Index register (must already exist) */ 554 /* First arg is the name of the Index register (must already exist) */
581 555
582 arg = op->common.value.arg; 556 arg = op->common.value.arg;
583 status = acpi_ns_lookup (walk_state->scope_info, arg->common.value.string, 557 status =
584 ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE, 558 acpi_ns_lookup(walk_state->scope_info, arg->common.value.string,
585 ACPI_NS_SEARCH_PARENT, walk_state, &info.register_node); 559 ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
586 if (ACPI_FAILURE (status)) { 560 ACPI_NS_SEARCH_PARENT, walk_state,
587 ACPI_REPORT_NSERROR (arg->common.value.string, status); 561 &info.register_node);
588 return_ACPI_STATUS (status); 562 if (ACPI_FAILURE(status)) {
563 ACPI_REPORT_NSERROR(arg->common.value.string, status);
564 return_ACPI_STATUS(status);
589 } 565 }
590 566
591 /* Second arg is the data register (must already exist) */ 567 /* Second arg is the data register (must already exist) */
592 568
593 arg = arg->common.next; 569 arg = arg->common.next;
594 status = acpi_ns_lookup (walk_state->scope_info, arg->common.value.string, 570 status =
595 ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE, 571 acpi_ns_lookup(walk_state->scope_info, arg->common.value.string,
596 ACPI_NS_SEARCH_PARENT, walk_state, &info.data_register_node); 572 ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
597 if (ACPI_FAILURE (status)) { 573 ACPI_NS_SEARCH_PARENT, walk_state,
598 ACPI_REPORT_NSERROR (arg->common.value.string, status); 574 &info.data_register_node);
599 return_ACPI_STATUS (status); 575 if (ACPI_FAILURE(status)) {
576 ACPI_REPORT_NSERROR(arg->common.value.string, status);
577 return_ACPI_STATUS(status);
600 } 578 }
601 579
602 /* Next arg is the field flags */ 580 /* Next arg is the field flags */
@@ -609,9 +587,7 @@ acpi_ds_create_index_field (
609 info.field_type = ACPI_TYPE_LOCAL_INDEX_FIELD; 587 info.field_type = ACPI_TYPE_LOCAL_INDEX_FIELD;
610 info.region_node = region_node; 588 info.region_node = region_node;
611 589
612 status = acpi_ds_get_field_names (&info, walk_state, arg->common.next); 590 status = acpi_ds_get_field_names(&info, walk_state, arg->common.next);
613 591
614 return_ACPI_STATUS (status); 592 return_ACPI_STATUS(status);
615} 593}
616
617