/*
* ACPI stuff
*/
-static void toshiba_haps_notify(struct acpi_device *device, u32 event)
+static void toshiba_haps_notify(acpi_handle handle, u32 event, void *data)
{
+ struct acpi_device *device = data;
+
pr_debug("Received event: 0x%x\n", event);
acpi_bus_generate_netlink_event(device->pnp.device_class,
static void toshiba_haps_remove(struct acpi_device *device)
{
+ acpi_dev_remove_notify_handler(device, ACPI_DEVICE_NOTIFY,
+ toshiba_haps_notify);
+
sysfs_remove_group(&device->dev.kobj, &haps_attr_group);
if (toshiba_haps)
if (ret)
return ret;
+ ret = acpi_dev_install_notify_handler(acpi_dev, ACPI_DEVICE_NOTIFY,
+ toshiba_haps_notify, acpi_dev);
+ if (ret)
+ goto err;
+
toshiba_haps = haps;
return 0;
+
+err:
+ sysfs_remove_group(&acpi_dev->dev.kobj, &haps_attr_group);
+ return ret;
}
#ifdef CONFIG_PM_SLEEP
.ops = {
.add = toshiba_haps_add,
.remove = toshiba_haps_remove,
- .notify = toshiba_haps_notify,
},
.drv.pm = &toshiba_haps_pm,
};