@@ -530,65 +530,30 @@ static void acpi_notify_device(acpi_handle handle, u32 event, void *data)
530
530
acpi_drv -> ops .notify (device , event );
531
531
}
532
532
533
- static void acpi_notify_device_fixed (void * data )
534
- {
535
- struct acpi_device * device = data ;
536
-
537
- /* Fixed hardware devices have no handles */
538
- acpi_notify_device (NULL , ACPI_FIXED_HARDWARE_EVENT , device );
539
- }
540
-
541
- static u32 acpi_device_fixed_event (void * data )
542
- {
543
- acpi_os_execute (OSL_NOTIFY_HANDLER , acpi_notify_device_fixed , data );
544
- return ACPI_INTERRUPT_HANDLED ;
545
- }
546
-
547
533
static int acpi_device_install_notify_handler (struct acpi_device * device ,
548
534
struct acpi_driver * acpi_drv )
549
535
{
550
- acpi_status status ;
551
-
552
- if (device -> device_type == ACPI_BUS_TYPE_POWER_BUTTON ) {
553
- status =
554
- acpi_install_fixed_event_handler (ACPI_EVENT_POWER_BUTTON ,
555
- acpi_device_fixed_event ,
556
- device );
557
- } else if (device -> device_type == ACPI_BUS_TYPE_SLEEP_BUTTON ) {
558
- status =
559
- acpi_install_fixed_event_handler (ACPI_EVENT_SLEEP_BUTTON ,
560
- acpi_device_fixed_event ,
561
- device );
562
- } else {
563
- u32 type = acpi_drv -> flags & ACPI_DRIVER_ALL_NOTIFY_EVENTS ?
536
+ u32 type = acpi_drv -> flags & ACPI_DRIVER_ALL_NOTIFY_EVENTS ?
564
537
ACPI_ALL_NOTIFY : ACPI_DEVICE_NOTIFY ;
538
+ acpi_status status ;
565
539
566
- status = acpi_install_notify_handler (device -> handle , type ,
567
- acpi_notify_device ,
568
- device );
569
- }
570
-
540
+ status = acpi_install_notify_handler (device -> handle , type ,
541
+ acpi_notify_device , device );
571
542
if (ACPI_FAILURE (status ))
572
543
return - EINVAL ;
544
+
573
545
return 0 ;
574
546
}
575
547
576
548
static void acpi_device_remove_notify_handler (struct acpi_device * device ,
577
549
struct acpi_driver * acpi_drv )
578
550
{
579
- if (device -> device_type == ACPI_BUS_TYPE_POWER_BUTTON ) {
580
- acpi_remove_fixed_event_handler (ACPI_EVENT_POWER_BUTTON ,
581
- acpi_device_fixed_event );
582
- } else if (device -> device_type == ACPI_BUS_TYPE_SLEEP_BUTTON ) {
583
- acpi_remove_fixed_event_handler (ACPI_EVENT_SLEEP_BUTTON ,
584
- acpi_device_fixed_event );
585
- } else {
586
- u32 type = acpi_drv -> flags & ACPI_DRIVER_ALL_NOTIFY_EVENTS ?
551
+ u32 type = acpi_drv -> flags & ACPI_DRIVER_ALL_NOTIFY_EVENTS ?
587
552
ACPI_ALL_NOTIFY : ACPI_DEVICE_NOTIFY ;
588
553
589
- acpi_remove_notify_handler (device -> handle , type ,
590
- acpi_notify_device );
591
- }
554
+ acpi_remove_notify_handler (device -> handle , type ,
555
+ acpi_notify_device );
556
+
592
557
acpi_os_wait_events_complete ();
593
558
}
594
559
0 commit comments