diff options
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/bus.c | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 19e78fb0a8d1..2b08c3dc79da 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c | |||
@@ -450,14 +450,13 @@ int acpi_bus_receive_event(struct acpi_bus_event *event) | |||
450 | Notification Handling | 450 | Notification Handling |
451 | -------------------------------------------------------------------------- */ | 451 | -------------------------------------------------------------------------- */ |
452 | 452 | ||
453 | static int acpi_bus_check_device(struct acpi_device *device) | 453 | static void acpi_bus_check_device(struct acpi_device *device) |
454 | { | 454 | { |
455 | acpi_status status = 0; | 455 | acpi_status status; |
456 | struct acpi_device_status old_status; | 456 | struct acpi_device_status old_status; |
457 | 457 | ||
458 | |||
459 | if (!device) | 458 | if (!device) |
460 | return -EINVAL; | 459 | return; |
461 | 460 | ||
462 | old_status = device->status; | 461 | old_status = device->status; |
463 | 462 | ||
@@ -467,15 +466,15 @@ static int acpi_bus_check_device(struct acpi_device *device) | |||
467 | */ | 466 | */ |
468 | if (device->parent && !device->parent->status.present) { | 467 | if (device->parent && !device->parent->status.present) { |
469 | device->status = device->parent->status; | 468 | device->status = device->parent->status; |
470 | return 0; | 469 | return; |
471 | } | 470 | } |
472 | 471 | ||
473 | status = acpi_bus_get_status(device); | 472 | status = acpi_bus_get_status(device); |
474 | if (ACPI_FAILURE(status)) | 473 | if (ACPI_FAILURE(status)) |
475 | return -ENODEV; | 474 | return; |
476 | 475 | ||
477 | if (STRUCT_TO_INT(old_status) == STRUCT_TO_INT(device->status)) | 476 | if (STRUCT_TO_INT(old_status) == STRUCT_TO_INT(device->status)) |
478 | return 0; | 477 | return; |
479 | 478 | ||
480 | /* | 479 | /* |
481 | * Device Insertion/Removal | 480 | * Device Insertion/Removal |
@@ -487,28 +486,20 @@ static int acpi_bus_check_device(struct acpi_device *device) | |||
487 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device removal detected\n")); | 486 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device removal detected\n")); |
488 | /* TBD: Handle device removal */ | 487 | /* TBD: Handle device removal */ |
489 | } | 488 | } |
490 | |||
491 | return 0; | ||
492 | } | 489 | } |
493 | 490 | ||
494 | static int acpi_bus_check_scope(struct acpi_device *device) | 491 | static void acpi_bus_check_scope(struct acpi_device *device) |
495 | { | 492 | { |
496 | int result = 0; | ||
497 | |||
498 | if (!device) | 493 | if (!device) |
499 | return -EINVAL; | 494 | return; |
500 | 495 | ||
501 | /* Status Change? */ | 496 | /* Status Change? */ |
502 | result = acpi_bus_check_device(device); | 497 | acpi_bus_check_device(device); |
503 | if (result) | ||
504 | return result; | ||
505 | 498 | ||
506 | /* | 499 | /* |
507 | * TBD: Enumerate child devices within this device's scope and | 500 | * TBD: Enumerate child devices within this device's scope and |
508 | * run acpi_bus_check_device()'s on them. | 501 | * run acpi_bus_check_device()'s on them. |
509 | */ | 502 | */ |
510 | |||
511 | return 0; | ||
512 | } | 503 | } |
513 | 504 | ||
514 | static BLOCKING_NOTIFIER_HEAD(acpi_bus_notify_list); | 505 | static BLOCKING_NOTIFIER_HEAD(acpi_bus_notify_list); |
@@ -531,7 +522,6 @@ EXPORT_SYMBOL_GPL(unregister_acpi_bus_notifier); | |||
531 | */ | 522 | */ |
532 | static void acpi_bus_notify(acpi_handle handle, u32 type, void *data) | 523 | static void acpi_bus_notify(acpi_handle handle, u32 type, void *data) |
533 | { | 524 | { |
534 | int result = 0; | ||
535 | struct acpi_device *device = NULL; | 525 | struct acpi_device *device = NULL; |
536 | struct acpi_driver *driver; | 526 | struct acpi_driver *driver; |
537 | 527 | ||
@@ -547,7 +537,7 @@ static void acpi_bus_notify(acpi_handle handle, u32 type, void *data) | |||
547 | switch (type) { | 537 | switch (type) { |
548 | 538 | ||
549 | case ACPI_NOTIFY_BUS_CHECK: | 539 | case ACPI_NOTIFY_BUS_CHECK: |
550 | result = acpi_bus_check_scope(device); | 540 | acpi_bus_check_scope(device); |
551 | /* | 541 | /* |
552 | * TBD: We'll need to outsource certain events to non-ACPI | 542 | * TBD: We'll need to outsource certain events to non-ACPI |
553 | * drivers via the device manager (device.c). | 543 | * drivers via the device manager (device.c). |
@@ -555,7 +545,7 @@ static void acpi_bus_notify(acpi_handle handle, u32 type, void *data) | |||
555 | break; | 545 | break; |
556 | 546 | ||
557 | case ACPI_NOTIFY_DEVICE_CHECK: | 547 | case ACPI_NOTIFY_DEVICE_CHECK: |
558 | result = acpi_bus_check_device(device); | 548 | acpi_bus_check_device(device); |
559 | /* | 549 | /* |
560 | * TBD: We'll need to outsource certain events to non-ACPI | 550 | * TBD: We'll need to outsource certain events to non-ACPI |
561 | * drivers via the device manager (device.c). | 551 | * drivers via the device manager (device.c). |