gpio: adp5585: use devm_blocking_notifier_chain_register()
PATCH 5/12 gpio: adp5585: use devm_blocking_notifier_chain_register()
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_gpio_unreg_notifier() callback.
--- drivers/gpio/gpio-adp5585.c | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-)
drivers/gpio/gpio-adp5585.c +3 -17
@@ -390,16 +390,6 @@ static const struct irq_chip adp5585_irq_chip = { GPIOCHIP_IRQ_RESOURCE_HELPERS, }; -static void adp5585_gpio_unreg_notifier (void *data) -{ -struct adp5585_gpio_dev *adp5585_gpio = data; -struct device *dev = adp5585_gpio->gpio_chip.parent; -struct adp5585_dev *adp5585 =dev_get_drvdata (dev->parent); - -blocking_notifier_chain_unregister (&adp5585->event_notifier, - &adp5585_gpio->nb); -} -static int adp5585_gpio_probe (struct platform_device *pdev) {struct adp5585_dev *adp5585 =dev_get_drvdata (pdev->dev.parent);
@@ -450,13 +440,9 @@ static int adp5585_gpio_probe(struct platform_device *pdev) girq->threaded = true; adp5585_gpio->nb.notifier_call = adp5585_gpio_key_event; - ret =blocking_notifier_chain_register (&adp5585->event_notifier, - &adp5585_gpio->nb); -if (ret) -return ret; - - ret =devm_add_action_or_reset (dev, adp5585_gpio_unreg_notifier, - adp5585_gpio); + ret =devm_blocking_notifier_chain_register (dev, + &adp5585->event_notifier, + &adp5585_gpio->nb);if (ret)return ret; }
Signature · 1 line
2.47.3
PATCH 6/12 platform/x86: bitland-mifs-wmi: use devm_blocking_notifier_chain_register()
Replace the blocking_notifier_chain_register() + devm_add_action_or_reset() pattern with a single call to devm_blocking_notifier_chain_register(), removing the bitland_notifier_unregister() callback.
--- drivers/platform/x86/bitland-mifs-wmi.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-)
drivers/platform/x86/bitland-mifs-wmi.c +3 -14
@@ -623,13 +623,6 @@ static const struct key_entry bitland_mifs_wmi_keymap[] = { { KE_END, 0 } }; -static void bitland_notifier_unregister (void *data) -{ -struct notifier_block *nb = data; - -blocking_notifier_chain_unregister (&bitland_notifier_list, nb); -} -static int bitland_notifier_callback (struct notifier_block *nb,unsigned long action,void *data) {
@@ -729,13 +722,9 @@ static int bitland_mifs_wmi_probe(struct wmi_device *wdev, const void *context)return ret; drv_data->notifier.notifier_call = bitland_notifier_callback; - ret =blocking_notifier_chain_register (&bitland_notifier_list, &drv_data->notifier); -if (ret) -return ret; - -return devm_add_action_or_reset (&wdev->dev, - bitland_notifier_unregister, - &drv_data->notifier); +return devm_blocking_notifier_chain_register (&wdev->dev, + &bitland_notifier_list, + &drv_data->notifier); } static void bitland_mifs_wmi_notify(struct wmi_device *wdev,
Signature · 1 line
2.47.3
PATCH 7/12 Input: adp5585: use devm_blocking_notifier_chain_register()
In reply to Eliav FarberReplace 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.
--- drivers/input/keyboard/adp5585-keys.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-)
drivers/input/keyboard/adp5585-keys.c +3 -15
@@ -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;
Signature · 1 line
2.47.3
Re: [PATCH 07/12] Input: adp5585: use devm_blocking_notifier_chain_register()
Quoted 6 lines · Eliav Farber
Replace the
blocking_notifier_chain_register()+devm_add_action_or_reset()pattern with a single call todevm_blocking_notifier_chain_register(), removing theadp5585_keys_unreg_notifier()callback.Signed-off-by Eliav Farber <[email protected]>
Feel free to merge with the rest of the series.
Thanks.
Signature · 1 line
Dmitry
PATCH 8/12 ACPI: APEI: GHES: use devm_blocking_notifier_chain_register()
In reply to Eliav FarberReplace 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.
--- drivers/acpi/apei/ghes.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-)
drivers/acpi/apei/ghes.c +3 -12
@@ -689,21 +689,12 @@ void ghes_unregister_vendor_record_notifier(struct notifier_block *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);
Signature · 1 line
2.47.3
Jonathan Cameron
maintainerRe: [PATCH 08/12] ACPI: APEI: GHES: use devm_blocking_notifier_chain_register()
Quoted 26 lines · On Thu, 23 Jul 2026 17:55:09 +0000 Eliav Farber <[email protected]> wrote:
Replace the
blocking_notifier_chain_register()+devm_add_action_or_reset()pattern with a single call todevm_blocking_notifier_chain_register(), removing theghes_vendor_record_notifier_destroy()callback.Signed-off-by Eliav Farber <[email protected]>--- drivers/acpi/apei/ghes.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-)drivers/acpi/apei/ghes.c +0
-5@@ -689,21 +689,12 @@ void ghes_unregister_vendor_record_noti fier(struct notifier_block *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) {
drivers/acpi/apei/ghes.c void ghes_unregister_vendor_record_noti fier(struct notifier_block *nb) · line 697
Quoted 10 lines
drivers/acpi/apei/ghes.c +3
-7-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);
Whilst correct, I'm less keen on this one because it looses the obvious connection to the non devm form. I suppose with the code being so near
to the non devm we can go with this.
For that matter why do we have the non devm variants? There are no users in tree. Can we just rip that and the unregister given this is removing the only users?
Thanks,
Jonathan
Quoted 3 lines
drivers/acpi/apei/ghes.c +0
-0}EXPORT_SYMBOL_GPL (devm_ghes_register_vendor_record_notifier);
RE: [PATCH 08/12] ACPI: APEI: GHES: use devm_blocking_notifier_chain_register()
Quoted 44 lines
Quoted 26 lines · On Thu, 23 Jul 2026 17:55:09 +0000 Eliav Farber <[email protected]> wrote:
Replace the
blocking_notifier_chain_register()+devm_add_action_or_reset()pattern with a single call todevm_blocking_notifier_chain_register(), removing theghes_vendor_record_notifier_destroy()callback.Signed-off-by Eliav Farber <[email protected]>--- drivers/acpi/apei/ghes.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-)drivers/acpi/apei/ghes.c +0
-5@@ -689,21 +689,12 @@ void ghes_unregister_vendor_record_noti fier(struct notifier_block *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) {drivers/acpi/apei/ghes.c void ghes_unregister_vendor_record_noti fier(struct notifier_block *nb) · line 697
Quoted 10 lines
drivers/acpi/apei/ghes.c +3
-7-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);Whilst correct, I'm less keen on this one because it looses the obvious connection to the non devm form. I suppose with the code being so near
to the non devm we can go with this.
Quoted 2 lines
For that matter why do we have the non devm variants? There are no users in tree. Can we just rip that and the unregister given this is removing the only users?
You're right - there are no in-tree users of the non-devm ghes_register_vendor_record_notifier() and ghes_unregister_vendor_record_notifier(). The only callers (pcie-hisi-error.c and ghes-nvidia.c) both use the devm variant.
I'll update this patch in v2 to also remove the non-devm functions and their EXPORT_SYMBOL_GPL()s, along with the declarations and kerneldoc in include/acpi/ghes.h.
PATCH 9/12 platform/x86: uniwill-wmi: use devm_blocking_notifier_chain_register()
In reply to Eliav FarberReplace 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.
--- drivers/platform/x86/uniwill/uniwill-wmi.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-)
drivers/platform/x86/uniwill/uniwill-wmi.c +3 -14
@@ -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)
Signature · 1 line
2.47.3
Quoted 7 lines · Eliav Farber
Replace the
blocking_notifier_chain_register()+devm_add_action_or_reset()pattern with a single call todevm_blocking_notifier_chain_register(), removing theadp5585_gpio_unreg_notifier()callback.Signed-off-by Eliav Farber <[email protected]>---