mirror of
https://github.com/torvalds/linux.git
synced 2026-06-01 19:13:47 +02:00
platform/x86: acer-wireless: Register ACPI notify handler directly
To facilitate subsequent conversion of the driver to a platform one, make it install an ACPI notify handler directly instead of using a .notify() callback in struct acpi_driver. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/10810967.nUPlyArG6x@rafael.j.wysocki Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
This commit is contained in:
parent
c2948247cd
commit
6fdc70794c
|
|
@ -18,8 +18,9 @@ static const struct acpi_device_id acer_wireless_acpi_ids[] = {
|
|||
};
|
||||
MODULE_DEVICE_TABLE(acpi, acer_wireless_acpi_ids);
|
||||
|
||||
static void acer_wireless_notify(struct acpi_device *adev, u32 event)
|
||||
static void acer_wireless_notify(acpi_handle handle, u32 event, void *data)
|
||||
{
|
||||
struct acpi_device *adev = data;
|
||||
struct input_dev *idev = acpi_driver_data(adev);
|
||||
|
||||
dev_dbg(&adev->dev, "event=%#x\n", event);
|
||||
|
|
@ -36,6 +37,7 @@ static void acer_wireless_notify(struct acpi_device *adev, u32 event)
|
|||
static int acer_wireless_add(struct acpi_device *adev)
|
||||
{
|
||||
struct input_dev *idev;
|
||||
int ret;
|
||||
|
||||
idev = devm_input_allocate_device(&adev->dev);
|
||||
if (!idev)
|
||||
|
|
@ -50,7 +52,18 @@ static int acer_wireless_add(struct acpi_device *adev)
|
|||
set_bit(EV_KEY, idev->evbit);
|
||||
set_bit(KEY_RFKILL, idev->keybit);
|
||||
|
||||
return input_register_device(idev);
|
||||
ret = input_register_device(idev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
return acpi_dev_install_notify_handler(adev, ACPI_DEVICE_NOTIFY,
|
||||
acer_wireless_notify, adev);
|
||||
}
|
||||
|
||||
static void acer_wireless_remove(struct acpi_device *adev)
|
||||
{
|
||||
acpi_dev_remove_notify_handler(adev, ACPI_DEVICE_NOTIFY,
|
||||
acer_wireless_notify);
|
||||
}
|
||||
|
||||
static struct acpi_driver acer_wireless_driver = {
|
||||
|
|
@ -59,7 +72,7 @@ static struct acpi_driver acer_wireless_driver = {
|
|||
.ids = acer_wireless_acpi_ids,
|
||||
.ops = {
|
||||
.add = acer_wireless_add,
|
||||
.notify = acer_wireless_notify,
|
||||
.remove = acer_wireless_remove,
|
||||
},
|
||||
};
|
||||
module_acpi_driver(acer_wireless_driver);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user