/**
* event_device_notify() - Callback when EC generates an event over ACPI.
- * @adev: The device that the event is coming from.
+ * @handle: ACPI handle of the device that the event is coming from.
* @value: Value passed to Notify() in ACPI.
+ * @data: Notify handler data.
*
* This function will read the events from the device and enqueue them.
*/
-static void event_device_notify(struct acpi_device *adev, u32 value)
+static void event_device_notify(acpi_handle handle, u32 value, void *data)
{
struct acpi_buffer event_buffer = { ACPI_ALLOCATE_BUFFER, NULL };
+ struct acpi_device *adev = data;
union acpi_object *obj;
acpi_status status;
if (error)
goto free_dev_data;
+ /* Install an ACPI notify handler. */
+ error = acpi_dev_install_notify_handler(adev, ACPI_DEVICE_NOTIFY,
+ event_device_notify, adev);
+ if (error)
+ goto free_cdev;
+
return 0;
+free_cdev:
+ cdev_device_del(&dev_data->cdev, &dev_data->dev);
free_dev_data:
hangup_device(dev_data);
free_minor:
{
struct event_device_data *dev_data = adev->driver_data;
+ acpi_dev_remove_notify_handler(adev, ACPI_DEVICE_NOTIFY,
+ event_device_notify);
cdev_device_del(&dev_data->cdev, &dev_data->dev);
ida_free(&event_ida, MINOR(dev_data->dev.devt));
hangup_device(dev_data);
.ids = event_acpi_ids,
.ops = {
.add = event_device_add,
- .notify = event_device_notify,
.remove = event_device_remove,
},
};