return status;
}
-static void cmpc_accel_handler_v4(struct acpi_device *dev, u32 event)
+static void cmpc_accel_handler_v4(acpi_handle handle, u32 event, void *data)
{
+ struct acpi_device *dev = data;
+
if (event == 0x81) {
int16_t x, y, z;
acpi_status status;
if (error)
goto failed_g_select;
+ error = acpi_dev_install_notify_handler(acpi, ACPI_DEVICE_NOTIFY,
+ cmpc_accel_handler_v4, acpi);
+ if (error)
+ goto failed_notify_handler;
+
dev_set_drvdata(&inputdev->dev, accel);
return 0;
+failed_notify_handler:
+ device_remove_file(&acpi->dev, &cmpc_accel_g_select_attr_v4);
failed_g_select:
device_remove_file(&acpi->dev, &cmpc_accel_sensitivity_attr_v4);
failed_sensitivity:
static void cmpc_accel_remove_v4(struct acpi_device *acpi)
{
+ acpi_dev_remove_notify_handler(acpi, ACPI_DEVICE_NOTIFY,
+ cmpc_accel_handler_v4);
device_remove_file(&acpi->dev, &cmpc_accel_g_select_attr_v4);
device_remove_file(&acpi->dev, &cmpc_accel_sensitivity_attr_v4);
cmpc_remove_notify_device(&acpi->dev);
.ops = {
.add = cmpc_accel_add_v4,
.remove = cmpc_accel_remove_v4,
- .notify = cmpc_accel_handler_v4,
},
.drv.pm = &cmpc_accel_pm,
};
return status;
}
-static void cmpc_accel_handler(struct acpi_device *dev, u32 event)
+static void cmpc_accel_handler(acpi_handle handle, u32 event, void *data)
{
+ struct acpi_device *dev = data;
+
if (event == 0x81) {
unsigned char x, y, z;
acpi_status status;
if (error)
goto failed_file;
+ error = acpi_dev_install_notify_handler(acpi, ACPI_DEVICE_NOTIFY,
+ cmpc_accel_handler, acpi);
+ if (error)
+ goto failed_notify_handler;
+
dev_set_drvdata(&inputdev->dev, accel);
return 0;
+failed_notify_handler:
+ device_remove_file(&acpi->dev, &cmpc_accel_sensitivity_attr);
failed_file:
cmpc_remove_notify_device(&acpi->dev);
return error;
static void cmpc_accel_remove(struct acpi_device *acpi)
{
+ acpi_dev_remove_notify_handler(acpi, ACPI_DEVICE_NOTIFY,
+ cmpc_accel_handler);
device_remove_file(&acpi->dev, &cmpc_accel_sensitivity_attr);
cmpc_remove_notify_device(&acpi->dev);
}
.ops = {
.add = cmpc_accel_add,
.remove = cmpc_accel_remove,
- .notify = cmpc_accel_handler,
}
};
return status;
}
-static void cmpc_tablet_handler(struct acpi_device *dev, u32 event)
+static void cmpc_tablet_handler(acpi_handle handle, u32 event, void *data)
{
+ struct acpi_device *dev = data;
unsigned long long val = 0;
struct input_dev *inputdev = dev_get_drvdata(&dev->dev);
static int cmpc_tablet_add(struct acpi_device *acpi)
{
- return cmpc_add_notify_device(&acpi->dev, "cmpc_tablet", cmpc_tablet_idev_init);
+ int error;
+
+ error = cmpc_add_notify_device(&acpi->dev, "cmpc_tablet", cmpc_tablet_idev_init);
+ if (error)
+ return error;
+
+ error = acpi_dev_install_notify_handler(acpi, ACPI_DEVICE_NOTIFY,
+ cmpc_tablet_handler, acpi);
+ if (error)
+ cmpc_remove_notify_device(&acpi->dev);
+
+ return error;
}
static void cmpc_tablet_remove(struct acpi_device *acpi)
{
+ acpi_dev_remove_notify_handler(acpi, ACPI_DEVICE_NOTIFY,
+ cmpc_tablet_handler);
cmpc_remove_notify_device(&acpi->dev);
}
.ops = {
.add = cmpc_tablet_add,
.remove = cmpc_tablet_remove,
- .notify = cmpc_tablet_handler,
},
.drv.pm = &cmpc_tablet_pm,
};
KEY_MAX
};
-static void cmpc_keys_handler(struct acpi_device *dev, u32 event)
+static void cmpc_keys_handler(acpi_handle handle, u32 event, void *data)
{
+ struct acpi_device *dev = data;
struct input_dev *inputdev;
int code = KEY_MAX;
static int cmpc_keys_add(struct acpi_device *acpi)
{
- return cmpc_add_notify_device(&acpi->dev, "cmpc_keys", cmpc_keys_idev_init);
+ int error;
+
+ error = cmpc_add_notify_device(&acpi->dev, "cmpc_keys", cmpc_keys_idev_init);
+ if (error)
+ return error;
+
+ error = acpi_dev_install_notify_handler(acpi, ACPI_DEVICE_NOTIFY,
+ cmpc_keys_handler, acpi);
+ if (error)
+ cmpc_remove_notify_device(&acpi->dev);
+
+ return error;
}
static void cmpc_keys_remove(struct acpi_device *acpi)
{
+ acpi_dev_remove_notify_handler(acpi, ACPI_DEVICE_NOTIFY,
+ cmpc_keys_handler);
cmpc_remove_notify_device(&acpi->dev);
}
.ops = {
.add = cmpc_keys_add,
.remove = cmpc_keys_remove,
- .notify = cmpc_keys_handler,
}
};