--- ac.c.orig 2004-08-15 14:34:03.000000000 -0400 +++ ac.c 2004-08-15 14:37:43.000000000 -0400 @@ -219,6 +219,7 @@ switch (event) { case ACPI_AC_NOTIFY_STATUS: + case ACPI_NOTIFY_BUS_CHECK: acpi_ac_get_state(ac); acpi_bus_generate_event(device, event, (u32) ac->state); break; @@ -272,6 +273,15 @@ goto end; } + status = acpi_install_notify_handler(ac->handle, + ACPI_SYSTEM_NOTIFY, acpi_ac_notify, ac); + if (ACPI_FAILURE(status)) { + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error installing system notify handler\n")); + result = -ENODEV; + goto end; + } + printk(KERN_INFO PREFIX "%s [%s] (%s)\n", acpi_device_name(device), acpi_device_bid(device), ac->state?"on-line":"off-line"); @@ -307,6 +317,12 @@ ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error removing notify handler\n")); + status = acpi_remove_notify_handler(ac->handle, + ACPI_SYSTEM_NOTIFY, acpi_ac_notify); + if (ACPI_FAILURE(status)) + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, + "Error removing system notify handler\n")); + acpi_ac_remove_fs(device); kfree(ac);