RE: [PATCH 01/12] notifier: add device-managed registration APIs
"Farber, Eliav" <[email protected]> Sun, 26 Jul 2026 04:27:20 +0000
| Newsgroups | org.kernel.vger.linux-pwm,org.kernel.vger.linux-acpi,org.kernel.vger.linux-gpio,org.kernel.vger.linux-iio,org.kernel.vger.linux-input,org.kernel.vger.linux-kernel,org.kernel.vger.platform-driver-x86 |
|---|---|
| Message-ID | <CH0PR18MB5433C53E35AB3D02D256CD5EC6CD2@CH0PR18MB5433.namprd18.prod.outlook.com> |
> > +struct device; > > struct notifier_block; > > > > typedef int (*notifier_fn_t)(struct notifier_block *nb, > > @@ -145,10 +146,19 @@ extern void srcu_init_notifier_head(struct > > srcu_notifier_head *nh); > > > > extern int atomic_notifier_chain_register(struct atomic_notifier_head *nh, > > struct notifier_block *nb); > > +extern int devm_atomic_notifier_chain_register(struct device *dev, > > + struct atomic_notifier_head *nh, > > + struct notifier_block *nb); > > Please don't use extern with function prototypes in new code. Fixed in v2 > > +/** > > + * devm_atomic_notifier_chain_register - Device-managed atomic notifier registration > > + * @dev: Device to tie the notifier lifetime to > > + * @nh: Pointer to head of the atomic notifier chain > > + * @n: New entry in notifier chain > > + * > > + * Adds a notifier to an atomic notifier chain and registers a cleanup > > + * action to automatically unregister it when @dev is unbound. > > + * > > + * Returns 0 on success, negative errno on error. > > Should be: > > Returns: > 0 on success... Fixed in v2 Thanks, Eliav