mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 05:04:02 +02:00
platform/x86: asus-laptop: 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> Reviewed-by: Denis Benato <denis.benato@linux.dev> Link: https://patch.msgid.link/5082508.31r3eYUQgx@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
3a96c7915d
commit
378500dc13
|
|
@ -1517,9 +1517,9 @@ static void asus_input_exit(struct asus_laptop *asus)
|
||||||
/*
|
/*
|
||||||
* ACPI driver
|
* ACPI driver
|
||||||
*/
|
*/
|
||||||
static void asus_acpi_notify(struct acpi_device *device, u32 event)
|
static void asus_acpi_notify(acpi_handle handle, u32 event, void *data)
|
||||||
{
|
{
|
||||||
struct asus_laptop *asus = acpi_driver_data(device);
|
struct asus_laptop *asus = data;
|
||||||
u16 count;
|
u16 count;
|
||||||
|
|
||||||
/* TODO Find a better way to handle events count. */
|
/* TODO Find a better way to handle events count. */
|
||||||
|
|
@ -1881,6 +1881,11 @@ static int asus_acpi_add(struct acpi_device *device)
|
||||||
if (result && result != -ENODEV)
|
if (result && result != -ENODEV)
|
||||||
goto fail_pega_rfkill;
|
goto fail_pega_rfkill;
|
||||||
|
|
||||||
|
result = acpi_dev_install_notify_handler(device, ACPI_DEVICE_NOTIFY,
|
||||||
|
asus_acpi_notify, asus);
|
||||||
|
if (result)
|
||||||
|
goto fail_pega_rfkill;
|
||||||
|
|
||||||
asus_device_present = true;
|
asus_device_present = true;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
@ -1906,6 +1911,7 @@ static void asus_acpi_remove(struct acpi_device *device)
|
||||||
{
|
{
|
||||||
struct asus_laptop *asus = acpi_driver_data(device);
|
struct asus_laptop *asus = acpi_driver_data(device);
|
||||||
|
|
||||||
|
acpi_dev_remove_notify_handler(device, ACPI_DEVICE_NOTIFY, asus_acpi_notify);
|
||||||
asus_backlight_exit(asus);
|
asus_backlight_exit(asus);
|
||||||
asus_rfkill_exit(asus);
|
asus_rfkill_exit(asus);
|
||||||
asus_led_exit(asus);
|
asus_led_exit(asus);
|
||||||
|
|
@ -1932,7 +1938,6 @@ static struct acpi_driver asus_acpi_driver = {
|
||||||
.ops = {
|
.ops = {
|
||||||
.add = asus_acpi_add,
|
.add = asus_acpi_add,
|
||||||
.remove = asus_acpi_remove,
|
.remove = asus_acpi_remove,
|
||||||
.notify = asus_acpi_notify,
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user