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: 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>

authored by

Rafael J. Wysocki and committed by
Ilpo Järvinen
32156fd2 553b2ac5

+15 -2
+15 -2
drivers/platform/x86/toshiba_haps.c
··· 129 129 /* 130 130 * ACPI stuff 131 131 */ 132 - static void toshiba_haps_notify(struct acpi_device *device, u32 event) 132 + static void toshiba_haps_notify(acpi_handle handle, u32 event, void *data) 133 133 { 134 + struct acpi_device *device = data; 135 + 134 136 pr_debug("Received event: 0x%x\n", event); 135 137 136 138 acpi_bus_generate_netlink_event(device->pnp.device_class, ··· 142 140 143 141 static void toshiba_haps_remove(struct acpi_device *device) 144 142 { 143 + acpi_dev_remove_notify_handler(device, ACPI_DEVICE_NOTIFY, 144 + toshiba_haps_notify); 145 + 145 146 sysfs_remove_group(&device->dev.kobj, &haps_attr_group); 146 147 147 148 if (toshiba_haps) ··· 206 201 if (ret) 207 202 return ret; 208 203 204 + ret = acpi_dev_install_notify_handler(acpi_dev, ACPI_DEVICE_NOTIFY, 205 + toshiba_haps_notify, acpi_dev); 206 + if (ret) 207 + goto err; 208 + 209 209 toshiba_haps = haps; 210 210 211 211 return 0; 212 + 213 + err: 214 + sysfs_remove_group(&acpi_dev->dev.kobj, &haps_attr_group); 215 + return ret; 212 216 } 213 217 214 218 #ifdef CONFIG_PM_SLEEP ··· 270 256 .ops = { 271 257 .add = toshiba_haps_add, 272 258 .remove = toshiba_haps_remove, 273 - .notify = toshiba_haps_notify, 274 259 }, 275 260 .drv.pm = &toshiba_haps_pm, 276 261 };