Re: [PATCH 00/12] notifier: add device-managed registration APIs and convert drivers

Bartosz Golaszewski <[email protected]> Fri, 24 Jul 2026 00:46:14 -0700
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 <CAMRc=Mfw0OXWF_1yU=5mBuXJscDv2H+JP1n4YicDUeMLwfjibg@mail.gmail.com>
On Thu, 23 Jul 2026 19:53:13 +0200, Eliav Farber <[email protected]> said:
> Many drivers repeat the same boilerplate when registering notifiers with
> device lifetime:
>
>   1. Register the notifier with *_notifier_chain_register()
>   2. Check for error
>   3. Register a devm action to unregister on teardown
>   4. Implement a per-driver static unregister callback
>
> This series adds devm_atomic_notifier_chain_register(),
> devm_blocking_notifier_chain_register(), and
> devm_raw_notifier_chain_register() that automatically unregister the
> notifier when the device is unbound, then converts 11 drivers to use
> them.
>
> Each conversion eliminates a per-driver unregister callback and the
> associated devm_add_action_or_reset() call, reducing code by ~15 lines
> per driver.
>
> The implementation follows the established devres pattern used by other
> device-managed kernel APIs.
>
> Checkpatch reports 6 CHECKs (0 errors, 0 warnings) on patch 1:
> - "extern prototypes should be avoided in .h files"
> - "Alignment should match open parenthesis"
>
> Both are intentional to match the existing coding style in notifier.h,
> where all declarations use 'extern' and tab-indented continuation lines.
>

What is the merging strategy? Acks and all patches go through driver core?

Bartosz