[PATCH v2 08/12] ACPI: APEI: GHES: use devm_blocking_notifier_chain_register()

From: Eliav Farber

Date: Sun Jul 26 2026 - 01:01:27 EST


Replace the blocking_notifier_chain_register() +
devm_add_action_or_reset() pattern with a single call to
devm_blocking_notifier_chain_register(), removing the
ghes_vendor_record_notifier_destroy() callback.

Since ghes_register_vendor_record_notifier() and
ghes_unregister_vendor_record_notifier() have no remaining in-tree
users, remove them along with their EXPORT_SYMBOL_GPL()s and
declarations in ghes.h.

Signed-off-by: Eliav Farber <farbere@xxxxxxxxxx>
---
Changes in v2:
- Also remove unused ghes_register_vendor_record_notifier() and
ghes_unregister_vendor_record_notifier() along with their
EXPORT_SYMBOL_GPL()s and ghes.h declarations, since there are no
in-tree callers (Jonathan Cameron)

drivers/acpi/apei/ghes.c | 27 +++------------------------
include/acpi/ghes.h | 16 ----------------
2 files changed, 3 insertions(+), 40 deletions(-)

diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
index 3236a3ce79d6..4419d430b7fd 100644
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -677,33 +677,12 @@ static void ghes_handle_aer(struct acpi_hest_generic_data *gdata)

static BLOCKING_NOTIFIER_HEAD(vendor_record_notify_list);

-int ghes_register_vendor_record_notifier(struct notifier_block *nb)
-{
- return blocking_notifier_chain_register(&vendor_record_notify_list, nb);
-}
-EXPORT_SYMBOL_GPL(ghes_register_vendor_record_notifier);
-
-void ghes_unregister_vendor_record_notifier(struct notifier_block *nb)
-{
- blocking_notifier_chain_unregister(&vendor_record_notify_list, nb);
-}
-EXPORT_SYMBOL_GPL(ghes_unregister_vendor_record_notifier);
-
-static void ghes_vendor_record_notifier_destroy(void *nb)
-{
- ghes_unregister_vendor_record_notifier(nb);
-}
-
int devm_ghes_register_vendor_record_notifier(struct device *dev,
struct notifier_block *nb)
{
- int ret;
-
- ret = ghes_register_vendor_record_notifier(nb);
- if (ret)
- return ret;
-
- return devm_add_action_or_reset(dev, ghes_vendor_record_notifier_destroy, nb);
+ return devm_blocking_notifier_chain_register(dev,
+ &vendor_record_notify_list,
+ nb);
}
EXPORT_SYMBOL_GPL(devm_ghes_register_vendor_record_notifier);

diff --git a/include/acpi/ghes.h b/include/acpi/ghes.h
index 8d7e5caef3f1..3cd13171c14f 100644
--- a/include/acpi/ghes.h
+++ b/include/acpi/ghes.h
@@ -55,22 +55,6 @@ enum {
};

#ifdef CONFIG_ACPI_APEI_GHES
-/**
- * ghes_register_vendor_record_notifier - register a notifier for vendor
- * records that the kernel would otherwise ignore.
- * @nb: pointer to the notifier_block structure of the event handler.
- *
- * return 0 : SUCCESS, non-zero : FAIL
- */
-int ghes_register_vendor_record_notifier(struct notifier_block *nb);
-
-/**
- * ghes_unregister_vendor_record_notifier - unregister the previously
- * registered vendor record notifier.
- * @nb: pointer to the notifier_block structure of the vendor record handler.
- */
-void ghes_unregister_vendor_record_notifier(struct notifier_block *nb);
-
/**
* devm_ghes_register_vendor_record_notifier - device-managed vendor
* record notifier registration.
--
2.47.3