RE: [PATCH v4 10/13] platform/x86: uniwill-wmi: use devm_blocking_notifier_chain_register()
"Farber, Eliav" <[email protected]>
| Newsgroups | org.kernel.vger.linux-iio,org.kernel.vger.linux-acpi,org.kernel.vger.linux-gpio,org.kernel.vger.linux-input,org.kernel.vger.linux-kernel,org.kernel.vger.linux-pwm,org.kernel.vger.platform-driver-x86 |
|---|---|
| Message-ID | <MN0PR18MB5870444BD9375EF4F7131851C6D82@MN0PR18MB5870.namprd18.prod.outlook.com> |
> On Sun, Jul 26, 2026 at 10:17:36AM +0000, Eliav Farber wrote:
> > 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);
> > }
>
> I'd remove this function and replace calls to it directly by devm_blocking_notifier_chain_register().
uniwill_wmi_chain_head is static in uniwill-wmi.c and the caller is in
uniwill-acpi.c. The wrapper encapsulates access to this module-private
notifier head - removing it would require exposing the variable through
the header, which breaks the current abstraction.
I'd prefer to keep the wrapper as-is.
Best regards
Eliav