Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
[sfrench/cifs-2.6.git] / drivers / acpi / ac.c
index 37c7dc4f9fe5db6d15b7bba43803790f0c0ee588..26d70702b3134124fc4e10111499c7fc990436c6 100644 (file)
@@ -34,7 +34,6 @@
 
 #define ACPI_AC_COMPONENT              0x00020000
 #define ACPI_AC_CLASS                  "ac_adapter"
-#define ACPI_AC_HID                    "ACPI0003"
 #define ACPI_AC_DEVICE_NAME            "AC Adapter"
 #define ACPI_AC_FILE_STATE             "state"
 #define ACPI_AC_NOTIFY_STATUS          0x80
@@ -56,10 +55,16 @@ static int acpi_ac_add(struct acpi_device *device);
 static int acpi_ac_remove(struct acpi_device *device, int type);
 static int acpi_ac_open_fs(struct inode *inode, struct file *file);
 
+const static struct acpi_device_id ac_device_ids[] = {
+       {"ACPI0003", 0},
+       {"", 0},
+};
+MODULE_DEVICE_TABLE(acpi, ac_device_ids);
+
 static struct acpi_driver acpi_ac_driver = {
        .name = "ac",
        .class = ACPI_AC_CLASS,
-       .ids = ACPI_AC_HID,
+       .ids = ac_device_ids,
        .ops = {
                .add = acpi_ac_add,
                .remove = acpi_ac_remove,
@@ -199,7 +204,10 @@ static void acpi_ac_notify(acpi_handle handle, u32 event, void *data)
        case ACPI_NOTIFY_BUS_CHECK:
        case ACPI_NOTIFY_DEVICE_CHECK:
                acpi_ac_get_state(ac);
-               acpi_bus_generate_event(device, event, (u32) ac->state);
+               acpi_bus_generate_proc_event(device, event, (u32) ac->state);
+               acpi_bus_generate_netlink_event(device->pnp.device_class,
+                                                 device->dev.bus_id, event,
+                                                 (u32) ac->state);
                break;
        default:
                ACPI_DEBUG_PRINT((ACPI_DB_INFO,