aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/events
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2006-10-02 00:00:00 -0400
committerLen Brown <len.brown@intel.com>2006-03-31 02:19:03 -0500
commit52fc0b026e99b5d5d585095148d997d5634bbc25 (patch)
tree7bf93132cfd3e6957308a84198ee159f7d43cf6f /drivers/acpi/events
parent46358614ed5b031797522f1020e989c959a8d8a6 (diff)
[ACPI] ACPICA 20060210
Removed a couple of extraneous ACPI_ERROR messages that appeared during normal execution. These became apparent after the conversion from ACPI_DEBUG_PRINT. Fixed a problem where the CreateField operator could hang if the BitIndex or NumBits parameter referred to a named object. From Valery Podrezov. http://bugzilla.kernel.org/show_bug.cgi?id=5359 Fixed a problem where a DeRefOf operation on a buffer object incorrectly failed with an exception. This also fixes a couple of related RefOf and DeRefOf issues. From Valery Podrezov. http://bugzilla.kernel.org/show_bug.cgi?id=5360 http://bugzilla.kernel.org/show_bug.cgi?id=5387 http://bugzilla.kernel.org/show_bug.cgi?id=5392 Fixed a problem where the AE_BUFFER_LIMIT exception was returned instead of AE_STRING_LIMIT on an out-of-bounds Index() operation. From Valery Podrezov. http://bugzilla.kernel.org/show_bug.cgi?id=5480 Implemented a memory cleanup at the end of the execution of each iteration of an AML While() loop, preventing the accumulation of outstanding objects. From Valery Podrezov. http://bugzilla.kernel.org/show_bug.cgi?id=5427 Eliminated a chunk of duplicate code in the object resolution code. From Valery Podrezov. http://bugzilla.kernel.org/show_bug.cgi?id=5336 Fixed several warnings during the 64-bit code generation. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/events')
-rw-r--r--drivers/acpi/events/evevent.c2
-rw-r--r--drivers/acpi/events/evgpe.c5
-rw-r--r--drivers/acpi/events/evgpeblk.c13
-rw-r--r--drivers/acpi/events/evmisc.c6
-rw-r--r--drivers/acpi/events/evregion.c10
-rw-r--r--drivers/acpi/events/evrgnini.c6
-rw-r--r--drivers/acpi/events/evxface.c3
-rw-r--r--drivers/acpi/events/evxfevnt.c1
-rw-r--r--drivers/acpi/events/evxfregn.c2
9 files changed, 48 insertions, 0 deletions
diff --git a/drivers/acpi/events/evevent.c b/drivers/acpi/events/evevent.c
index c9ac05c4685f..c8d9752e3128 100644
--- a/drivers/acpi/events/evevent.c
+++ b/drivers/acpi/events/evevent.c
@@ -260,12 +260,14 @@ u32 acpi_ev_fixed_event_detect(void)
260 * Check for all possible Fixed Events and dispatch those that are active 260 * Check for all possible Fixed Events and dispatch those that are active
261 */ 261 */
262 for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++) { 262 for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++) {
263
263 /* Both the status and enable bits must be on for this event */ 264 /* Both the status and enable bits must be on for this event */
264 265
265 if ((fixed_status & acpi_gbl_fixed_event_info[i]. 266 if ((fixed_status & acpi_gbl_fixed_event_info[i].
266 status_bit_mask) 267 status_bit_mask)
267 && (fixed_enable & acpi_gbl_fixed_event_info[i]. 268 && (fixed_enable & acpi_gbl_fixed_event_info[i].
268 enable_bit_mask)) { 269 enable_bit_mask)) {
270
269 /* Found an active (signalled) event */ 271 /* Found an active (signalled) event */
270 272
271 int_status |= acpi_ev_fixed_event_dispatch((u32) i); 273 int_status |= acpi_ev_fixed_event_dispatch((u32) i);
diff --git a/drivers/acpi/events/evgpe.c b/drivers/acpi/events/evgpe.c
index f64f977dd3d5..7d7b81af972e 100644
--- a/drivers/acpi/events/evgpe.c
+++ b/drivers/acpi/events/evgpe.c
@@ -207,6 +207,7 @@ acpi_ev_enable_gpe(struct acpi_gpe_event_info *gpe_event_info,
207 ACPI_SET_BIT(gpe_event_info->flags, ACPI_GPE_RUN_ENABLED); 207 ACPI_SET_BIT(gpe_event_info->flags, ACPI_GPE_RUN_ENABLED);
208 208
209 if (write_to_hardware) { 209 if (write_to_hardware) {
210
210 /* Clear the GPE (of stale events), then enable it */ 211 /* Clear the GPE (of stale events), then enable it */
211 212
212 status = acpi_hw_clear_gpe(gpe_event_info); 213 status = acpi_hw_clear_gpe(gpe_event_info);
@@ -313,6 +314,7 @@ struct acpi_gpe_event_info *acpi_ev_get_gpe_event_info(acpi_handle gpe_device,
313 /* A NULL gpe_block means use the FADT-defined GPE block(s) */ 314 /* A NULL gpe_block means use the FADT-defined GPE block(s) */
314 315
315 if (!gpe_device) { 316 if (!gpe_device) {
317
316 /* Examine GPE Block 0 and 1 (These blocks are permanent) */ 318 /* Examine GPE Block 0 and 1 (These blocks are permanent) */
317 319
318 for (i = 0; i < ACPI_MAX_GPE_BLOCKS; i++) { 320 for (i = 0; i < ACPI_MAX_GPE_BLOCKS; i++) {
@@ -402,6 +404,7 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list)
402 * Find all currently active GP events. 404 * Find all currently active GP events.
403 */ 405 */
404 for (i = 0; i < gpe_block->register_count; i++) { 406 for (i = 0; i < gpe_block->register_count; i++) {
407
405 /* Get the next status/enable pair */ 408 /* Get the next status/enable pair */
406 409
407 gpe_register_info = &gpe_block->register_info[i]; 410 gpe_register_info = &gpe_block->register_info[i];
@@ -437,6 +440,7 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list)
437 440
438 enabled_status_byte = (u8) (status_reg & enable_reg); 441 enabled_status_byte = (u8) (status_reg & enable_reg);
439 if (!enabled_status_byte) { 442 if (!enabled_status_byte) {
443
440 /* No active GPEs in this register, move on */ 444 /* No active GPEs in this register, move on */
441 445
442 continue; 446 continue;
@@ -445,6 +449,7 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list)
445 /* Now look at the individual GPEs in this byte register */ 449 /* Now look at the individual GPEs in this byte register */
446 450
447 for (j = 0; j < ACPI_GPE_REGISTER_WIDTH; j++) { 451 for (j = 0; j < ACPI_GPE_REGISTER_WIDTH; j++) {
452
448 /* Examine one GPE bit */ 453 /* Examine one GPE bit */
449 454
450 if (enabled_status_byte & 455 if (enabled_status_byte &
diff --git a/drivers/acpi/events/evgpeblk.c b/drivers/acpi/events/evgpeblk.c
index 0fd00b5ad650..87e77a138fff 100644
--- a/drivers/acpi/events/evgpeblk.c
+++ b/drivers/acpi/events/evgpeblk.c
@@ -146,10 +146,12 @@ acpi_status acpi_ev_walk_gpe_list(ACPI_GPE_CALLBACK gpe_walk_callback)
146 146
147 gpe_xrupt_info = acpi_gbl_gpe_xrupt_list_head; 147 gpe_xrupt_info = acpi_gbl_gpe_xrupt_list_head;
148 while (gpe_xrupt_info) { 148 while (gpe_xrupt_info) {
149
149 /* Walk all Gpe Blocks attached to this interrupt level */ 150 /* Walk all Gpe Blocks attached to this interrupt level */
150 151
151 gpe_block = gpe_xrupt_info->gpe_block_list_head; 152 gpe_block = gpe_xrupt_info->gpe_block_list_head;
152 while (gpe_block) { 153 while (gpe_block) {
154
153 /* One callback per GPE block */ 155 /* One callback per GPE block */
154 156
155 status = gpe_walk_callback(gpe_xrupt_info, gpe_block); 157 status = gpe_walk_callback(gpe_xrupt_info, gpe_block);
@@ -195,6 +197,7 @@ acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
195 /* Examine each GPE Register within the block */ 197 /* Examine each GPE Register within the block */
196 198
197 for (i = 0; i < gpe_block->register_count; i++) { 199 for (i = 0; i < gpe_block->register_count; i++) {
200
198 /* Now look at the individual GPEs in this byte register */ 201 /* Now look at the individual GPEs in this byte register */
199 202
200 for (j = 0; j < ACPI_GPE_REGISTER_WIDTH; j++) { 203 for (j = 0; j < ACPI_GPE_REGISTER_WIDTH; j++) {
@@ -289,6 +292,7 @@ acpi_ev_save_method_info(acpi_handle obj_handle,
289 292
290 gpe_number = ACPI_STRTOUL(&name[2], NULL, 16); 293 gpe_number = ACPI_STRTOUL(&name[2], NULL, 16);
291 if (gpe_number == ACPI_UINT32_MAX) { 294 if (gpe_number == ACPI_UINT32_MAX) {
295
292 /* Conversion failed; invalid method, just ignore it */ 296 /* Conversion failed; invalid method, just ignore it */
293 297
294 ACPI_ERROR((AE_INFO, 298 ACPI_ERROR((AE_INFO,
@@ -371,6 +375,7 @@ acpi_ev_match_prw_and_gpe(acpi_handle obj_handle,
371 status = acpi_ut_evaluate_object(obj_handle, METHOD_NAME__PRW, 375 status = acpi_ut_evaluate_object(obj_handle, METHOD_NAME__PRW,
372 ACPI_BTYPE_PACKAGE, &pkg_desc); 376 ACPI_BTYPE_PACKAGE, &pkg_desc);
373 if (ACPI_FAILURE(status)) { 377 if (ACPI_FAILURE(status)) {
378
374 /* Ignore all errors from _PRW, we don't want to abort the subsystem */ 379 /* Ignore all errors from _PRW, we don't want to abort the subsystem */
375 380
376 return_ACPI_STATUS(AE_OK); 381 return_ACPI_STATUS(AE_OK);
@@ -394,6 +399,7 @@ acpi_ev_match_prw_and_gpe(acpi_handle obj_handle,
394 obj_desc = pkg_desc->package.elements[0]; 399 obj_desc = pkg_desc->package.elements[0];
395 400
396 if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_INTEGER) { 401 if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_INTEGER) {
402
397 /* Use FADT-defined GPE device (from definition of _PRW) */ 403 /* Use FADT-defined GPE device (from definition of _PRW) */
398 404
399 target_gpe_device = acpi_gbl_fadt_gpe_device; 405 target_gpe_device = acpi_gbl_fadt_gpe_device;
@@ -402,6 +408,7 @@ acpi_ev_match_prw_and_gpe(acpi_handle obj_handle,
402 408
403 gpe_number = (u32) obj_desc->integer.value; 409 gpe_number = (u32) obj_desc->integer.value;
404 } else if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_PACKAGE) { 410 } else if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_PACKAGE) {
411
405 /* Package contains a GPE reference and GPE number within a GPE block */ 412 /* Package contains a GPE reference and GPE number within a GPE block */
406 413
407 if ((obj_desc->package.count < 2) || 414 if ((obj_desc->package.count < 2) ||
@@ -679,6 +686,7 @@ acpi_status acpi_ev_delete_gpe_block(struct acpi_gpe_block_info *gpe_block)
679 status = acpi_hw_disable_gpe_block(gpe_block->xrupt_block, gpe_block); 686 status = acpi_hw_disable_gpe_block(gpe_block->xrupt_block, gpe_block);
680 687
681 if (!gpe_block->previous && !gpe_block->next) { 688 if (!gpe_block->previous && !gpe_block->next) {
689
682 /* This is the last gpe_block on this interrupt */ 690 /* This is the last gpe_block on this interrupt */
683 691
684 status = acpi_ev_delete_gpe_xrupt(gpe_block->xrupt_block); 692 status = acpi_ev_delete_gpe_xrupt(gpe_block->xrupt_block);
@@ -780,6 +788,7 @@ acpi_ev_create_gpe_info_blocks(struct acpi_gpe_block_info *gpe_block)
780 this_event = gpe_event_info; 788 this_event = gpe_event_info;
781 789
782 for (i = 0; i < gpe_block->register_count; i++) { 790 for (i = 0; i < gpe_block->register_count; i++) {
791
783 /* Init the register_info for this GPE register (8 GPEs) */ 792 /* Init the register_info for this GPE register (8 GPEs) */
784 793
785 this_register->base_gpe_number = 794 this_register->base_gpe_number =
@@ -1013,6 +1022,7 @@ acpi_ev_initialize_gpe_block(struct acpi_namespace_node *gpe_device,
1013 1022
1014 for (i = 0; i < gpe_block->register_count; i++) { 1023 for (i = 0; i < gpe_block->register_count; i++) {
1015 for (j = 0; j < 8; j++) { 1024 for (j = 0; j < 8; j++) {
1025
1016 /* Get the info block for this particular GPE */ 1026 /* Get the info block for this particular GPE */
1017 1027
1018 gpe_event_info = 1028 gpe_event_info =
@@ -1099,6 +1109,7 @@ acpi_status acpi_ev_gpe_initialize(void)
1099 * particular block is not supported. 1109 * particular block is not supported.
1100 */ 1110 */
1101 if (acpi_gbl_FADT->gpe0_blk_len && acpi_gbl_FADT->xgpe0_blk.address) { 1111 if (acpi_gbl_FADT->gpe0_blk_len && acpi_gbl_FADT->xgpe0_blk.address) {
1112
1102 /* GPE block 0 exists (has both length and address > 0) */ 1113 /* GPE block 0 exists (has both length and address > 0) */
1103 1114
1104 register_count0 = (u16) (acpi_gbl_FADT->gpe0_blk_len / 2); 1115 register_count0 = (u16) (acpi_gbl_FADT->gpe0_blk_len / 2);
@@ -1121,6 +1132,7 @@ acpi_status acpi_ev_gpe_initialize(void)
1121 } 1132 }
1122 1133
1123 if (acpi_gbl_FADT->gpe1_blk_len && acpi_gbl_FADT->xgpe1_blk.address) { 1134 if (acpi_gbl_FADT->gpe1_blk_len && acpi_gbl_FADT->xgpe1_blk.address) {
1135
1124 /* GPE block 1 exists (has both length and address > 0) */ 1136 /* GPE block 1 exists (has both length and address > 0) */
1125 1137
1126 register_count1 = (u16) (acpi_gbl_FADT->gpe1_blk_len / 2); 1138 register_count1 = (u16) (acpi_gbl_FADT->gpe1_blk_len / 2);
@@ -1168,6 +1180,7 @@ acpi_status acpi_ev_gpe_initialize(void)
1168 /* Exit if there are no GPE registers */ 1180 /* Exit if there are no GPE registers */
1169 1181
1170 if ((register_count0 + register_count1) == 0) { 1182 if ((register_count0 + register_count1) == 0) {
1183
1171 /* GPEs are not required by ACPI, this is OK */ 1184 /* GPEs are not required by ACPI, this is OK */
1172 1185
1173 ACPI_DEBUG_PRINT((ACPI_DB_INIT, 1186 ACPI_DEBUG_PRINT((ACPI_DB_INIT,
diff --git a/drivers/acpi/events/evmisc.c b/drivers/acpi/events/evmisc.c
index 0909ba69577e..334407239f2f 100644
--- a/drivers/acpi/events/evmisc.c
+++ b/drivers/acpi/events/evmisc.c
@@ -150,6 +150,7 @@ acpi_ev_queue_notify_request(struct acpi_namespace_node * node,
150 150
151 obj_desc = acpi_ns_get_attached_object(node); 151 obj_desc = acpi_ns_get_attached_object(node);
152 if (obj_desc) { 152 if (obj_desc) {
153
153 /* We have the notify object, Get the right handler */ 154 /* We have the notify object, Get the right handler */
154 155
155 switch (node->type) { 156 switch (node->type) {
@@ -240,6 +241,7 @@ static void ACPI_SYSTEM_XFACE acpi_ev_notify_dispatch(void *context)
240 * to the device. 241 * to the device.
241 */ 242 */
242 if (notify_info->notify.value <= ACPI_MAX_SYS_NOTIFY) { 243 if (notify_info->notify.value <= ACPI_MAX_SYS_NOTIFY) {
244
243 /* Global system notification handler */ 245 /* Global system notification handler */
244 246
245 if (acpi_gbl_system_notify.handler) { 247 if (acpi_gbl_system_notify.handler) {
@@ -297,6 +299,7 @@ static void ACPI_SYSTEM_XFACE acpi_ev_global_lock_thread(void *context)
297 /* Signal threads that are waiting for the lock */ 299 /* Signal threads that are waiting for the lock */
298 300
299 if (acpi_gbl_global_lock_thread_count) { 301 if (acpi_gbl_global_lock_thread_count) {
302
300 /* Send sufficient units to the semaphore */ 303 /* Send sufficient units to the semaphore */
301 304
302 status = 305 status =
@@ -335,6 +338,7 @@ static u32 acpi_ev_global_lock_handler(void *context)
335 */ 338 */
336 ACPI_ACQUIRE_GLOBAL_LOCK(acpi_gbl_common_fACS.global_lock, acquired); 339 ACPI_ACQUIRE_GLOBAL_LOCK(acpi_gbl_common_fACS.global_lock, acquired);
337 if (acquired) { 340 if (acquired) {
341
338 /* Got the lock, now wake all threads waiting for it */ 342 /* Got the lock, now wake all threads waiting for it */
339 343
340 acpi_gbl_global_lock_acquired = TRUE; 344 acpi_gbl_global_lock_acquired = TRUE;
@@ -439,6 +443,7 @@ acpi_status acpi_ev_acquire_global_lock(u16 timeout)
439 443
440 ACPI_ACQUIRE_GLOBAL_LOCK(acpi_gbl_common_fACS.global_lock, acquired); 444 ACPI_ACQUIRE_GLOBAL_LOCK(acpi_gbl_common_fACS.global_lock, acquired);
441 if (acquired) { 445 if (acquired) {
446
442 /* We got the lock */ 447 /* We got the lock */
443 448
444 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, 449 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
@@ -492,6 +497,7 @@ acpi_status acpi_ev_release_global_lock(void)
492 497
493 acpi_gbl_global_lock_thread_count--; 498 acpi_gbl_global_lock_thread_count--;
494 if (acpi_gbl_global_lock_thread_count) { 499 if (acpi_gbl_global_lock_thread_count) {
500
495 /* There are still some threads holding the lock, cannot release */ 501 /* There are still some threads holding the lock, cannot release */
496 502
497 return_ACPI_STATUS(AE_OK); 503 return_ACPI_STATUS(AE_OK);
diff --git a/drivers/acpi/events/evregion.c b/drivers/acpi/events/evregion.c
index 6da58e776413..b831ec4bcae7 100644
--- a/drivers/acpi/events/evregion.c
+++ b/drivers/acpi/events/evregion.c
@@ -164,6 +164,7 @@ acpi_status acpi_ev_initialize_op_regions(void)
164 * Run the _REG methods for op_regions in each default address space 164 * Run the _REG methods for op_regions in each default address space
165 */ 165 */
166 for (i = 0; i < ACPI_NUM_DEFAULT_SPACES; i++) { 166 for (i = 0; i < ACPI_NUM_DEFAULT_SPACES; i++) {
167
167 /* TBD: Make sure handler is the DEFAULT handler, otherwise 168 /* TBD: Make sure handler is the DEFAULT handler, otherwise
168 * _REG will have already been run. 169 * _REG will have already been run.
169 */ 170 */
@@ -315,6 +316,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
315 */ 316 */
316 region_setup = handler_desc->address_space.setup; 317 region_setup = handler_desc->address_space.setup;
317 if (!region_setup) { 318 if (!region_setup) {
319
318 /* No initialization routine, exit with error */ 320 /* No initialization routine, exit with error */
319 321
320 ACPI_ERROR((AE_INFO, 322 ACPI_ERROR((AE_INFO,
@@ -361,6 +363,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
361 region_obj->region.flags |= AOPOBJ_SETUP_COMPLETE; 363 region_obj->region.flags |= AOPOBJ_SETUP_COMPLETE;
362 364
363 if (region_obj2->extra.region_context) { 365 if (region_obj2->extra.region_context) {
366
364 /* The handler for this region was already installed */ 367 /* The handler for this region was already installed */
365 368
366 ACPI_MEM_FREE(region_context); 369 ACPI_MEM_FREE(region_context);
@@ -463,6 +466,7 @@ acpi_ev_detach_region(union acpi_operand_object *region_obj,
463 466
464 handler_obj = region_obj->region.handler; 467 handler_obj = region_obj->region.handler;
465 if (!handler_obj) { 468 if (!handler_obj) {
469
466 /* This region has no handler, all done */ 470 /* This region has no handler, all done */
467 471
468 return_VOID; 472 return_VOID;
@@ -474,6 +478,7 @@ acpi_ev_detach_region(union acpi_operand_object *region_obj,
474 last_obj_ptr = &handler_obj->address_space.region_list; 478 last_obj_ptr = &handler_obj->address_space.region_list;
475 479
476 while (obj_desc) { 480 while (obj_desc) {
481
477 /* Is this the correct Region? */ 482 /* Is this the correct Region? */
478 483
479 if (obj_desc == region_obj) { 484 if (obj_desc == region_obj) {
@@ -666,6 +671,7 @@ acpi_ev_install_handler(acpi_handle obj_handle,
666 671
667 obj_desc = acpi_ns_get_attached_object(node); 672 obj_desc = acpi_ns_get_attached_object(node);
668 if (!obj_desc) { 673 if (!obj_desc) {
674
669 /* No object, just exit */ 675 /* No object, just exit */
670 676
671 return (AE_OK); 677 return (AE_OK);
@@ -674,10 +680,12 @@ acpi_ev_install_handler(acpi_handle obj_handle,
674 /* Devices are handled different than regions */ 680 /* Devices are handled different than regions */
675 681
676 if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_DEVICE) { 682 if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_DEVICE) {
683
677 /* Check if this Device already has a handler for this address space */ 684 /* Check if this Device already has a handler for this address space */
678 685
679 next_handler_obj = obj_desc->device.handler; 686 next_handler_obj = obj_desc->device.handler;
680 while (next_handler_obj) { 687 while (next_handler_obj) {
688
681 /* Found a handler, is it for the same address space? */ 689 /* Found a handler, is it for the same address space? */
682 690
683 if (next_handler_obj->address_space.space_id == 691 if (next_handler_obj->address_space.space_id ==
@@ -839,6 +847,7 @@ acpi_ev_install_space_handler(struct acpi_namespace_node * node,
839 /* Walk the handler list for this device */ 847 /* Walk the handler list for this device */
840 848
841 while (handler_obj) { 849 while (handler_obj) {
850
842 /* Same space_id indicates a handler already installed */ 851 /* Same space_id indicates a handler already installed */
843 852
844 if (handler_obj->address_space.space_id == space_id) { 853 if (handler_obj->address_space.space_id == space_id) {
@@ -1035,6 +1044,7 @@ acpi_ev_reg_run(acpi_handle obj_handle,
1035 1044
1036 obj_desc = acpi_ns_get_attached_object(node); 1045 obj_desc = acpi_ns_get_attached_object(node);
1037 if (!obj_desc) { 1046 if (!obj_desc) {
1047
1038 /* No object, just exit */ 1048 /* No object, just exit */
1039 1049
1040 return (AE_OK); 1050 return (AE_OK);
diff --git a/drivers/acpi/events/evrgnini.c b/drivers/acpi/events/evrgnini.c
index baed8c1a1b9f..a0bffc2a0787 100644
--- a/drivers/acpi/events/evrgnini.c
+++ b/drivers/acpi/events/evrgnini.c
@@ -199,6 +199,7 @@ acpi_ev_pci_config_region_setup(acpi_handle handle,
199 * handlers with that device. 199 * handlers with that device.
200 */ 200 */
201 if (handler_obj->address_space.node == acpi_gbl_root_node) { 201 if (handler_obj->address_space.node == acpi_gbl_root_node) {
202
202 /* Start search from the parent object */ 203 /* Start search from the parent object */
203 204
204 pci_root_node = parent_node; 205 pci_root_node = parent_node;
@@ -220,6 +221,7 @@ acpi_ev_pci_config_region_setup(acpi_handle handle,
220 PCI_EXPRESS_ROOT_HID_STRING, 221 PCI_EXPRESS_ROOT_HID_STRING,
221 sizeof(PCI_EXPRESS_ROOT_HID_STRING))))) 222 sizeof(PCI_EXPRESS_ROOT_HID_STRING)))))
222 { 223 {
224
223 /* Install a handler for this PCI root bridge */ 225 /* Install a handler for this PCI root bridge */
224 226
225 status = 227 status =
@@ -478,11 +480,13 @@ acpi_ev_initialize_region(union acpi_operand_object *region_obj,
478 * ie: acpi_gbl_root_node->parent_entry being set to NULL 480 * ie: acpi_gbl_root_node->parent_entry being set to NULL
479 */ 481 */
480 while (node) { 482 while (node) {
483
481 /* Check to see if a handler exists */ 484 /* Check to see if a handler exists */
482 485
483 handler_obj = NULL; 486 handler_obj = NULL;
484 obj_desc = acpi_ns_get_attached_object(node); 487 obj_desc = acpi_ns_get_attached_object(node);
485 if (obj_desc) { 488 if (obj_desc) {
489
486 /* Can only be a handler if the object exists */ 490 /* Can only be a handler if the object exists */
487 491
488 switch (node->type) { 492 switch (node->type) {
@@ -507,10 +511,12 @@ acpi_ev_initialize_region(union acpi_operand_object *region_obj,
507 } 511 }
508 512
509 while (handler_obj) { 513 while (handler_obj) {
514
510 /* Is this handler of the correct type? */ 515 /* Is this handler of the correct type? */
511 516
512 if (handler_obj->address_space.space_id == 517 if (handler_obj->address_space.space_id ==
513 space_id) { 518 space_id) {
519
514 /* Found correct handler */ 520 /* Found correct handler */
515 521
516 ACPI_DEBUG_PRINT((ACPI_DB_OPREGION, 522 ACPI_DEBUG_PRINT((ACPI_DB_OPREGION,
diff --git a/drivers/acpi/events/evxface.c b/drivers/acpi/events/evxface.c
index b38b39dde543..ba16fda3a158 100644
--- a/drivers/acpi/events/evxface.c
+++ b/drivers/acpi/events/evxface.c
@@ -275,6 +275,7 @@ acpi_install_notify_handler(acpi_handle device,
275 * only one <external> global handler can be regsitered (per notify type). 275 * only one <external> global handler can be regsitered (per notify type).
276 */ 276 */
277 if (device == ACPI_ROOT_OBJECT) { 277 if (device == ACPI_ROOT_OBJECT) {
278
278 /* Make sure the handler is not already installed */ 279 /* Make sure the handler is not already installed */
279 280
280 if (((handler_type & ACPI_SYSTEM_NOTIFY) && 281 if (((handler_type & ACPI_SYSTEM_NOTIFY) &&
@@ -317,6 +318,7 @@ acpi_install_notify_handler(acpi_handle device,
317 318
318 obj_desc = acpi_ns_get_attached_object(node); 319 obj_desc = acpi_ns_get_attached_object(node);
319 if (obj_desc) { 320 if (obj_desc) {
321
320 /* Object exists - make sure there's no handler */ 322 /* Object exists - make sure there's no handler */
321 323
322 if (((handler_type & ACPI_SYSTEM_NOTIFY) && 324 if (((handler_type & ACPI_SYSTEM_NOTIFY) &&
@@ -370,6 +372,7 @@ acpi_install_notify_handler(acpi_handle device,
370 } 372 }
371 373
372 if (handler_type == ACPI_ALL_NOTIFY) { 374 if (handler_type == ACPI_ALL_NOTIFY) {
375
373 /* Extra ref if installed in both */ 376 /* Extra ref if installed in both */
374 377
375 acpi_ut_add_reference(notify_obj); 378 acpi_ut_add_reference(notify_obj);
diff --git a/drivers/acpi/events/evxfevnt.c b/drivers/acpi/events/evxfevnt.c
index ec9ce8429f15..babebb501405 100644
--- a/drivers/acpi/events/evxfevnt.c
+++ b/drivers/acpi/events/evxfevnt.c
@@ -636,6 +636,7 @@ acpi_install_gpe_block(acpi_handle gpe_device,
636 636
637 obj_desc = acpi_ns_get_attached_object(node); 637 obj_desc = acpi_ns_get_attached_object(node);
638 if (!obj_desc) { 638 if (!obj_desc) {
639
639 /* No object, create a new one */ 640 /* No object, create a new one */
640 641
641 obj_desc = acpi_ut_create_internal_object(ACPI_TYPE_DEVICE); 642 obj_desc = acpi_ut_create_internal_object(ACPI_TYPE_DEVICE);
diff --git a/drivers/acpi/events/evxfregn.c b/drivers/acpi/events/evxfregn.c
index abf5caca9ae5..368c8aa0094b 100644
--- a/drivers/acpi/events/evxfregn.c
+++ b/drivers/acpi/events/evxfregn.c
@@ -176,9 +176,11 @@ acpi_remove_address_space_handler(acpi_handle device,
176 handler_obj = obj_desc->device.handler; 176 handler_obj = obj_desc->device.handler;
177 last_obj_ptr = &obj_desc->device.handler; 177 last_obj_ptr = &obj_desc->device.handler;
178 while (handler_obj) { 178 while (handler_obj) {
179
179 /* We have a handler, see if user requested this one */ 180 /* We have a handler, see if user requested this one */
180 181
181 if (handler_obj->address_space.space_id == space_id) { 182 if (handler_obj->address_space.space_id == space_id) {
183
182 /* Matched space_id, first dereference this in the Regions */ 184 /* Matched space_id, first dereference this in the Regions */
183 185
184 ACPI_DEBUG_PRINT((ACPI_DB_OPREGION, 186 ACPI_DEBUG_PRINT((ACPI_DB_OPREGION,