summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2026-03-24 21:02:14 +0100
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>2026-03-31 19:14:33 +0300
commit32156fd2fbb8fc2d049ad459336cd71b2556f75a (patch)
treead1bc057107a595a4ae61757987421502126a63d
parent553b2ac59fbb434330287fde0cabc64bc6f11ceb (diff)
platform/x86: toshiba_haps: 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/10834562.nUPlyArG6x@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/toshiba_haps.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/platform/x86/toshiba_haps.c b/drivers/platform/x86/toshiba_haps.c
index e9324bf16aea..6eac306cf92a 100644
--- a/drivers/platform/x86/toshiba_haps.c
+++ b/drivers/platform/x86/toshiba_haps.c
@@ -129,8 +129,10 @@ static const struct attribute_group haps_attr_group = {
/*
* ACPI stuff
*/
-static void toshiba_haps_notify(struct acpi_device *device, u32 event)
+static void toshiba_haps_notify(acpi_handle handle, u32 event, void *data)
{
+ struct acpi_device *device = data;
+
pr_debug("Received event: 0x%x\n", event);
acpi_bus_generate_netlink_event(device->pnp.device_class,
@@ -140,6 +142,9 @@ static void toshiba_haps_notify(struct acpi_device *device, u32 event)
static void toshiba_haps_remove(struct acpi_device *device)
{
+ acpi_dev_remove_notify_handler(device, ACPI_DEVICE_NOTIFY,
+ toshiba_haps_notify);
+
sysfs_remove_group(&device->dev.kobj, &haps_attr_group);
if (toshiba_haps)
@@ -201,9 +206,18 @@ static int toshiba_haps_add(struct acpi_device *acpi_dev)
if (ret)
return ret;
+ ret = acpi_dev_install_notify_handler(acpi_dev, ACPI_DEVICE_NOTIFY,
+ toshiba_haps_notify, acpi_dev);
+ if (ret)
+ goto err;
+
toshiba_haps = haps;
return 0;
+
+err:
+ sysfs_remove_group(&acpi_dev->dev.kobj, &haps_attr_group);
+ return ret;
}
#ifdef CONFIG_PM_SLEEP
@@ -256,7 +270,6 @@ static struct acpi_driver toshiba_haps_driver = {
.ops = {
.add = toshiba_haps_add,
.remove = toshiba_haps_remove,
- .notify = toshiba_haps_notify,
},
.drv.pm = &toshiba_haps_pm,
};