aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/acpi/bus.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index 2b08c3dc79da..2876fc70c3a9 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -450,11 +450,14 @@ int acpi_bus_receive_event(struct acpi_bus_event *event)
450 Notification Handling 450 Notification Handling
451 -------------------------------------------------------------------------- */ 451 -------------------------------------------------------------------------- */
452 452
453static void acpi_bus_check_device(struct acpi_device *device) 453static void acpi_bus_check_device(acpi_handle handle)
454{ 454{
455 struct acpi_device *device;
455 acpi_status status; 456 acpi_status status;
456 struct acpi_device_status old_status; 457 struct acpi_device_status old_status;
457 458
459 if (acpi_bus_get_device(handle, &device))
460 return;
458 if (!device) 461 if (!device)
459 return; 462 return;
460 463
@@ -488,13 +491,10 @@ static void acpi_bus_check_device(struct acpi_device *device)
488 } 491 }
489} 492}
490 493
491static void acpi_bus_check_scope(struct acpi_device *device) 494static void acpi_bus_check_scope(acpi_handle handle)
492{ 495{
493 if (!device)
494 return;
495
496 /* Status Change? */ 496 /* Status Change? */
497 acpi_bus_check_device(device); 497 acpi_bus_check_device(handle);
498 498
499 /* 499 /*
500 * TBD: Enumerate child devices within this device's scope and 500 * TBD: Enumerate child devices within this device's scope and
@@ -531,13 +531,10 @@ static void acpi_bus_notify(acpi_handle handle, u32 type, void *data)
531 blocking_notifier_call_chain(&acpi_bus_notify_list, 531 blocking_notifier_call_chain(&acpi_bus_notify_list,
532 type, (void *)handle); 532 type, (void *)handle);
533 533
534 if (acpi_bus_get_device(handle, &device))
535 return;
536
537 switch (type) { 534 switch (type) {
538 535
539 case ACPI_NOTIFY_BUS_CHECK: 536 case ACPI_NOTIFY_BUS_CHECK:
540 acpi_bus_check_scope(device); 537 acpi_bus_check_scope(handle);
541 /* 538 /*
542 * TBD: We'll need to outsource certain events to non-ACPI 539 * TBD: We'll need to outsource certain events to non-ACPI
543 * drivers via the device manager (device.c). 540 * drivers via the device manager (device.c).
@@ -545,7 +542,7 @@ static void acpi_bus_notify(acpi_handle handle, u32 type, void *data)
545 break; 542 break;
546 543
547 case ACPI_NOTIFY_DEVICE_CHECK: 544 case ACPI_NOTIFY_DEVICE_CHECK:
548 acpi_bus_check_device(device); 545 acpi_bus_check_device(handle);
549 /* 546 /*
550 * TBD: We'll need to outsource certain events to non-ACPI 547 * TBD: We'll need to outsource certain events to non-ACPI
551 * drivers via the device manager (device.c). 548 * drivers via the device manager (device.c).
@@ -583,10 +580,13 @@ static void acpi_bus_notify(acpi_handle handle, u32 type, void *data)
583 break; 580 break;
584 } 581 }
585 582
586 driver = device->driver; 583 acpi_bus_get_device(handle, &device);
587 if (driver && driver->ops.notify && 584 if (device) {
588 (driver->flags & ACPI_DRIVER_ALL_NOTIFY_EVENTS)) 585 driver = device->driver;
589 driver->ops.notify(device, type); 586 if (driver && driver->ops.notify &&
587 (driver->flags & ACPI_DRIVER_ALL_NOTIFY_EVENTS))
588 driver->ops.notify(device, type);
589 }
590} 590}
591 591
592/* -------------------------------------------------------------------------- 592/* --------------------------------------------------------------------------