summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2026-03-12 12:28:52 +0100
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>2026-03-17 19:39:58 +0200
commit0f2ca62fdfbcada9568fbc7e27e94e4b3bffbf7a (patch)
treebbe5319f1f241b7fccea4bfb4d35753e2d61e29b
parent2d9cb20610f75ca48c1cac064aede90196787507 (diff)
platform/x86: sony-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> Link: https://patch.msgid.link/2559802.jE0xQCEvom@rafael.j.wysocki Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
-rw-r--r--drivers/platform/x86/sony-laptop.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
index d3e7a52c22a7..6f417b5cdfe2 100644
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -1176,7 +1176,7 @@ enum event_types {
KILLSWITCH,
GFX_SWITCH
};
-static void sony_nc_notify(struct acpi_device *device, u32 event)
+static void sony_nc_notify(acpi_handle ah, u32 event, void *data)
{
u32 real_ev = event;
u8 ev_type = 0;
@@ -3244,6 +3244,11 @@ static int sony_nc_add(struct acpi_device *device)
}
}
+ result = acpi_dev_install_notify_handler(device, ACPI_DEVICE_NOTIFY,
+ sony_nc_notify, NULL);
+ if (result)
+ goto out_sysfs;
+
pr_info("SNC setup done.\n");
return 0;
@@ -3270,6 +3275,8 @@ static void sony_nc_remove(struct acpi_device *device)
{
struct sony_nc_value *item;
+ acpi_dev_remove_notify_handler(device, ACPI_DEVICE_NOTIFY, sony_nc_notify);
+
sony_nc_backlight_cleanup();
sony_nc_acpi_device = NULL;
@@ -3304,7 +3311,6 @@ static struct acpi_driver sony_nc_driver = {
.ops = {
.add = sony_nc_add,
.remove = sony_nc_remove,
- .notify = sony_nc_notify,
},
.drv.pm = &sony_nc_pm,
};