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

From: Farber, Eliav

Date: Sun Jul 26 2026 - 00:13:55 EST


> On Thu, 23 Jul 2026 17:55:09 +0000
> Eliav Farber <farbere@xxxxxxxxxx> wrote:
>
> > 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 <farbere@xxxxxxxxxx>
> > ---
> > drivers/acpi/apei/ghes.c | 15 +++------------
> > 1 file changed, 3 insertions(+), 12 deletions(-)
> >
> > diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
> > index 3236a3ce79d6..3aa29dcd70da 100644
> > --- a/drivers/acpi/apei/ghes.c
> > +++ b/drivers/acpi/apei/ghes.c
> > @@ -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)
> > {
> > - 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?

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.