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.
Signed-off-by: Eliav Farber <redacted>
---
Changes in v4:
- Split removal of unused code into a separate preceding patch
(Andy Shevchenko)
drivers/acpi/apei/ghes.c | 17 +++--------------
1 file changed, 3 insertions(+), 14 deletions(-)
diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
index 4e092f71ca84..4419d430b7fd 100644
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -677,23 +677,12 @@ static void ghes_handle_aer(struct acpi_hest_generic_data *gdata)
static BLOCKING_NOTIFIER_HEAD(vendor_record_notify_list);
-static void ghes_vendor_record_notifier_destroy(void *data)
-{
- struct notifier_block *nb = data;
-
- blocking_notifier_chain_unregister(&vendor_record_notify_list, nb);
-}
-
int devm_ghes_register_vendor_record_notifier(struct device *dev,
struct notifier_block *nb)
{
- int ret;
-
- ret = blocking_notifier_chain_register(&vendor_record_notify_list, 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);
--
2.47.3