Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Rafael J. Wysocki and committed by
Ilpo Järvinen
378500dc 3a96c791

+8 -3
+8 -3
drivers/platform/x86/asus-laptop.c
··· 1517 1517 /* 1518 1518 * ACPI driver 1519 1519 */ 1520 - static void asus_acpi_notify(struct acpi_device *device, u32 event) 1520 + static void asus_acpi_notify(acpi_handle handle, u32 event, void *data) 1521 1521 { 1522 - struct asus_laptop *asus = acpi_driver_data(device); 1522 + struct asus_laptop *asus = data; 1523 1523 u16 count; 1524 1524 1525 1525 /* TODO Find a better way to handle events count. */ ··· 1881 1881 if (result && result != -ENODEV) 1882 1882 goto fail_pega_rfkill; 1883 1883 1884 + result = acpi_dev_install_notify_handler(device, ACPI_DEVICE_NOTIFY, 1885 + asus_acpi_notify, asus); 1886 + if (result) 1887 + goto fail_pega_rfkill; 1888 + 1884 1889 asus_device_present = true; 1885 1890 return 0; 1886 1891 ··· 1911 1906 { 1912 1907 struct asus_laptop *asus = acpi_driver_data(device); 1913 1908 1909 + acpi_dev_remove_notify_handler(device, ACPI_DEVICE_NOTIFY, asus_acpi_notify); 1914 1910 asus_backlight_exit(asus); 1915 1911 asus_rfkill_exit(asus); 1916 1912 asus_led_exit(asus); ··· 1938 1932 .ops = { 1939 1933 .add = asus_acpi_add, 1940 1934 .remove = asus_acpi_remove, 1941 - .notify = asus_acpi_notify, 1942 1935 }, 1943 1936 }; 1944 1937