Skip to content

Commit 898ff0f

Browse files
mwilczyrafaeljw
authored andcommitted
ACPI: HED: Install Notify() handler directly
Modify the ACPI HED driver to install its own Notify() handler directly instead of providing an ACPI driver .notify() callback. This will allow the ACPI driver .notify() callback to be eliminated and it will allow the HED driver to be switched over to a platform one in the future. Suggested-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Michal Wilczynski <michal.wilczynski@intel.com> [ rjw: Subject and changelog edits, whitespace adjustments ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 1066625 commit 898ff0f

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

drivers/acpi/hed.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,22 +42,32 @@ EXPORT_SYMBOL_GPL(unregister_acpi_hed_notifier);
4242
* it is used by HEST Generic Hardware Error Source with notify type
4343
* SCI.
4444
*/
45-
static void acpi_hed_notify(struct acpi_device *device, u32 event)
45+
static void acpi_hed_notify(acpi_handle handle, u32 event, void *data)
4646
{
4747
blocking_notifier_call_chain(&acpi_hed_notify_list, 0, NULL);
4848
}
4949

5050
static int acpi_hed_add(struct acpi_device *device)
5151
{
52+
int err;
53+
5254
/* Only one hardware error device */
5355
if (hed_handle)
5456
return -EINVAL;
5557
hed_handle = device->handle;
56-
return 0;
58+
59+
err = acpi_dev_install_notify_handler(device, ACPI_DEVICE_NOTIFY,
60+
acpi_hed_notify);
61+
if (err)
62+
hed_handle = NULL;
63+
64+
return err;
5765
}
5866

5967
static void acpi_hed_remove(struct acpi_device *device)
6068
{
69+
acpi_dev_remove_notify_handler(device, ACPI_DEVICE_NOTIFY,
70+
acpi_hed_notify);
6171
hed_handle = NULL;
6272
}
6373

@@ -68,7 +78,6 @@ static struct acpi_driver acpi_hed_driver = {
6878
.ops = {
6979
.add = acpi_hed_add,
7080
.remove = acpi_hed_remove,
71-
.notify = acpi_hed_notify,
7281
},
7382
};
7483
module_acpi_driver(acpi_hed_driver);

0 commit comments

Comments
 (0)