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: system76: 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/13970743.uLZWGnKmhe@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
89729c9c 5539165c

+11 -5
+11 -5
drivers/platform/x86/system76_acpi.c
··· 644 644 } 645 645 646 646 // Handle ACPI notification 647 - static void system76_notify(struct acpi_device *acpi_dev, u32 event) 647 + static void system76_notify(acpi_handle handle, u32 event, void *context) 648 648 { 649 - struct system76_data *data; 649 + struct system76_data *data = context; 650 650 651 - data = acpi_driver_data(acpi_dev); 652 651 switch (event) { 653 652 case 0x80: 654 653 kb_led_hotkey_hardware(data); ··· 756 757 757 758 err = input_register_device(data->input); 758 759 if (err) 759 - goto error; 760 + return err; 761 + 762 + err = acpi_dev_install_notify_handler(acpi_dev, ACPI_DEVICE_NOTIFY, 763 + system76_notify, data); 764 + if (err) 765 + return err; 760 766 761 767 if (data->has_open_ec) { 762 768 err = system76_get_object(data, "NFAN", &data->nfan); ··· 788 784 kfree(data->ntmp); 789 785 kfree(data->nfan); 790 786 } 787 + acpi_dev_remove_notify_handler(acpi_dev, ACPI_DEVICE_NOTIFY, system76_notify); 791 788 return err; 792 789 } 793 790 ··· 805 800 kfree(data->ntmp); 806 801 } 807 802 803 + acpi_dev_remove_notify_handler(acpi_dev, ACPI_DEVICE_NOTIFY, system76_notify); 804 + 808 805 system76_get(data, "FINI"); 809 806 } 810 807 ··· 817 810 .ops = { 818 811 .add = system76_add, 819 812 .remove = system76_remove, 820 - .notify = system76_notify, 821 813 }, 822 814 }; 823 815 module_acpi_driver(system76_driver);