[PATCH 07/12] Input: adp5585: use devm_blocking_notifier_chain_register()

From: Eliav Farber

Date: Thu Jul 23 2026 - 14:12:36 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
adp5585_keys_unreg_notifier() callback.

Signed-off-by: Eliav Farber <farbere@xxxxxxxxxx>
---
drivers/input/keyboard/adp5585-keys.c | 18 +++---------------
1 file changed, 3 insertions(+), 15 deletions(-)

diff --git a/drivers/input/keyboard/adp5585-keys.c b/drivers/input/keyboard/adp5585-keys.c
index 017c95029180..0be4cc234c21 100644
--- a/drivers/input/keyboard/adp5585-keys.c
+++ b/drivers/input/keyboard/adp5585-keys.c
@@ -254,15 +254,6 @@ static int adp5585_keys_ev_handle(struct notifier_block *nb, unsigned long key,
return NOTIFY_STOP;
}

-static void adp5585_keys_unreg_notifier(void *data)
-{
- struct adp5585_kpad *kpad = data;
- struct adp5585_dev *adp5585 = dev_get_drvdata(kpad->dev->parent);
-
- blocking_notifier_chain_unregister(&adp5585->event_notifier,
- &kpad->nb);
-}
-
static int adp5585_keys_probe(struct platform_device *pdev)
{
const struct platform_device_id *id = platform_get_device_id(pdev);
@@ -318,12 +309,9 @@ static int adp5585_keys_probe(struct platform_device *pdev)
return error;

kpad->nb.notifier_call = adp5585_keys_ev_handle;
- error = blocking_notifier_chain_register(&adp5585->event_notifier,
- &kpad->nb);
- if (error)
- return error;
-
- error = devm_add_action_or_reset(dev, adp5585_keys_unreg_notifier, kpad);
+ error = devm_blocking_notifier_chain_register(dev,
+ &adp5585->event_notifier,
+ &kpad->nb);
if (error)
return error;

--
2.47.3