fix console change race exposed by CFS
[pandora-kernel.git] / drivers / acpi / button.c
index c726612..2e79a33 100644 (file)
@@ -34,7 +34,6 @@
 #include <acpi/acpi_drivers.h>
 
 #define ACPI_BUTTON_COMPONENT          0x00080000
-#define ACPI_BUTTON_DRIVER_NAME                "ACPI Button Driver"
 #define ACPI_BUTTON_CLASS              "button"
 #define ACPI_BUTTON_FILE_INFO          "info"
 #define ACPI_BUTTON_FILE_STATE         "state"
 #define ACPI_BUTTON_TYPE_LID           0x05
 
 #define _COMPONENT             ACPI_BUTTON_COMPONENT
-ACPI_MODULE_NAME("acpi_button")
+ACPI_MODULE_NAME("button");
 
 MODULE_AUTHOR("Paul Diefenbaugh");
-MODULE_DESCRIPTION(ACPI_BUTTON_DRIVER_NAME);
+MODULE_DESCRIPTION("ACPI Button Driver");
 MODULE_LICENSE("GPL");
 
+static const struct acpi_device_id button_device_ids[] = {
+       {ACPI_BUTTON_HID_LID,    0},
+       {ACPI_BUTTON_HID_SLEEP,  0},
+       {ACPI_BUTTON_HID_SLEEPF, 0},
+       {ACPI_BUTTON_HID_POWER,  0},
+       {ACPI_BUTTON_HID_POWERF, 0},
+       {"", 0},
+};
+MODULE_DEVICE_TABLE(acpi, button_device_ids);
+
 static int acpi_button_add(struct acpi_device *device);
 static int acpi_button_remove(struct acpi_device *device, int type);
 static int acpi_button_info_open_fs(struct inode *inode, struct file *file);
 static int acpi_button_state_open_fs(struct inode *inode, struct file *file);
 
 static struct acpi_driver acpi_button_driver = {
-       .name = ACPI_BUTTON_DRIVER_NAME,
+       .name = "button",
        .class = ACPI_BUTTON_CLASS,
-       .ids = "button_power,button_sleep,PNP0C0D,PNP0C0C,PNP0C0E",
+       .ids = button_device_ids,
        .ops = {
                .add = acpi_button_add,
                .remove = acpi_button_remove,
@@ -275,7 +284,7 @@ static void acpi_button_notify(acpi_handle handle, u32 event, void *data)
                }
                input_sync(input);
 
-               acpi_bus_generate_event(button->device, event,
+               acpi_bus_generate_proc_event(button->device, event,
                                        ++button->pushed);
                break;
        default: