[PATCH v4 10/13] platform/x86: uniwill-wmi: use devm_blocking_notifier_chain_register()

From: Eliav Farber

Date: Sun Jul 26 2026 - 06:20:01 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
devm_uniwill_wmi_unregister_notifier() callback.

Signed-off-by: Eliav Farber <farbere@xxxxxxxxxx>
---
drivers/platform/x86/uniwill/uniwill-wmi.c | 17 +++--------------
1 file changed, 3 insertions(+), 14 deletions(-)

diff --git a/drivers/platform/x86/uniwill/uniwill-wmi.c b/drivers/platform/x86/uniwill/uniwill-wmi.c
index afcbfa4f7552..2ffa29a829ee 100644
--- a/drivers/platform/x86/uniwill/uniwill-wmi.c
+++ b/drivers/platform/x86/uniwill/uniwill-wmi.c
@@ -26,22 +26,11 @@

static BLOCKING_NOTIFIER_HEAD(uniwill_wmi_chain_head);

-static void devm_uniwill_wmi_unregister_notifier(void *data)
-{
- struct notifier_block *nb = data;
-
- blocking_notifier_chain_unregister(&uniwill_wmi_chain_head, nb);
-}
-
int devm_uniwill_wmi_register_notifier(struct device *dev, struct notifier_block *nb)
{
- int ret;
-
- ret = blocking_notifier_chain_register(&uniwill_wmi_chain_head, nb);
- if (ret < 0)
- return ret;
-
- return devm_add_action_or_reset(dev, devm_uniwill_wmi_unregister_notifier, nb);
+ return devm_blocking_notifier_chain_register(dev,
+ &uniwill_wmi_chain_head,
+ nb);
}

static void uniwill_wmi_notify(struct wmi_device *wdev, union acpi_object *obj)
--
2.47.3