@@ -530,65 +530,30 @@ static void acpi_notify_device(acpi_handle handle, u32 event, void *data)
530530 acpi_drv -> ops .notify (device , event );
531531}
532532
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-
547533static int acpi_device_install_notify_handler (struct acpi_device * device ,
548534 struct acpi_driver * acpi_drv )
549535{
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 ?
564537 ACPI_ALL_NOTIFY : ACPI_DEVICE_NOTIFY ;
538+ acpi_status status ;
565539
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 );
571542 if (ACPI_FAILURE (status ))
572543 return - EINVAL ;
544+
573545 return 0 ;
574546}
575547
576548static void acpi_device_remove_notify_handler (struct acpi_device * device ,
577549 struct acpi_driver * acpi_drv )
578550{
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 ?
587552 ACPI_ALL_NOTIFY : ACPI_DEVICE_NOTIFY ;
588553
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+
592557 acpi_os_wait_events_complete ();
593558}
594559
0 commit comments