mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 18:13:41 +02:00
platform/x86: fujitsu: Register ACPI notify handlers directly
To facilitate subsequent conversion of the driver to using struct platform_driver instead of struct acpi_driver, make it install its ACPI notify handlers directly instead of using struct acpi_driver .notify() callbacks. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Jonathan Woithe <jwoithe@just42.net> Link: https://patch.msgid.link/3035290.e9J7NaK4W3@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
c256927c62
commit
9b9271ac2a
|
|
@ -502,8 +502,9 @@ static int fujitsu_backlight_register(struct acpi_device *device)
|
|||
|
||||
/* Brightness notify */
|
||||
|
||||
static void acpi_fujitsu_bl_notify(struct acpi_device *device, u32 event)
|
||||
static void acpi_fujitsu_bl_notify(acpi_handle handle, u32 event, void *data)
|
||||
{
|
||||
struct acpi_device *device = data;
|
||||
struct fujitsu_bl *priv = acpi_driver_data(device);
|
||||
int oldb, newb;
|
||||
|
||||
|
|
@ -558,7 +559,18 @@ static int acpi_fujitsu_bl_add(struct acpi_device *device)
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
return fujitsu_backlight_register(device);
|
||||
ret = fujitsu_backlight_register(device);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
return acpi_dev_install_notify_handler(device, ACPI_DEVICE_NOTIFY,
|
||||
acpi_fujitsu_bl_notify, device);
|
||||
}
|
||||
|
||||
static void acpi_fujitsu_bl_remove(struct acpi_device *device)
|
||||
{
|
||||
acpi_dev_remove_notify_handler(device, ACPI_DEVICE_NOTIFY,
|
||||
acpi_fujitsu_bl_notify);
|
||||
}
|
||||
|
||||
/* ACPI device for hotkey handling */
|
||||
|
|
@ -941,8 +953,9 @@ static void acpi_fujitsu_laptop_release(struct acpi_device *device)
|
|||
}
|
||||
}
|
||||
|
||||
static void acpi_fujitsu_laptop_notify(struct acpi_device *device, u32 event)
|
||||
static void acpi_fujitsu_laptop_notify(acpi_handle handle, u32 event, void *data)
|
||||
{
|
||||
struct acpi_device *device = data;
|
||||
struct fujitsu_laptop *priv = acpi_driver_data(device);
|
||||
unsigned long flags;
|
||||
int scancode, i = 0;
|
||||
|
|
@ -1056,12 +1069,19 @@ static int acpi_fujitsu_laptop_add(struct acpi_device *device)
|
|||
if (ret)
|
||||
goto err_free_fifo;
|
||||
|
||||
ret = acpi_dev_install_notify_handler(device, ACPI_DEVICE_NOTIFY,
|
||||
acpi_fujitsu_laptop_notify, device);
|
||||
if (ret)
|
||||
goto err_platform_remove;
|
||||
|
||||
ret = fujitsu_battery_charge_control_add(device);
|
||||
if (ret < 0)
|
||||
pr_warn("Unable to register battery charge control: %d\n", ret);
|
||||
|
||||
return 0;
|
||||
|
||||
err_platform_remove:
|
||||
fujitsu_laptop_platform_remove(device);
|
||||
err_free_fifo:
|
||||
kfifo_free(&priv->fifo);
|
||||
|
||||
|
|
@ -1074,6 +1094,9 @@ static void acpi_fujitsu_laptop_remove(struct acpi_device *device)
|
|||
|
||||
fujitsu_battery_charge_control_remove(device);
|
||||
|
||||
acpi_dev_remove_notify_handler(device, ACPI_DEVICE_NOTIFY,
|
||||
acpi_fujitsu_laptop_notify);
|
||||
|
||||
fujitsu_laptop_platform_remove(device);
|
||||
|
||||
kfifo_free(&priv->fifo);
|
||||
|
|
@ -1092,7 +1115,7 @@ static struct acpi_driver acpi_fujitsu_bl_driver = {
|
|||
.ids = fujitsu_bl_device_ids,
|
||||
.ops = {
|
||||
.add = acpi_fujitsu_bl_add,
|
||||
.notify = acpi_fujitsu_bl_notify,
|
||||
.remove = acpi_fujitsu_bl_remove,
|
||||
},
|
||||
};
|
||||
|
||||
|
|
@ -1108,7 +1131,6 @@ static struct acpi_driver acpi_fujitsu_laptop_driver = {
|
|||
.ops = {
|
||||
.add = acpi_fujitsu_laptop_add,
|
||||
.remove = acpi_fujitsu_laptop_remove,
|
||||
.notify = acpi_fujitsu_laptop_notify,
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user