devm_extcon...ter_notifier(9)
π NAME π
devm_extcon_register_notifier β it's literally the resource-managed version of extcon_register_notifier() β¨ (yes, the Kernel API Manual girlies stay winning)
π SYNOPSIS π
int devm_extcon_register_notifier (struct device *dev , struct extcon_dev *edev , unsigned int id , struct notifier_block *nb );
π¦ ARGUMENTS π¦
devβ the device that owns the extcon device being created π«Ά like, this is the main character's parent, okurredevβ the extcon device itself, hi bestie πidβ the unique id among the extcon enumeration π₯ unique queen behavior, no dupes allowednbβ a notifier block to be registered π the little block that's about to be on the list
πΈ DESCRIPTION πΈ
Okay so here's the tea β: this function manages the notifier of an extcon device automatically, using device resource management β which is the whole point, it lowkey simplifies the control of unregistering the notifier of the extcon device. You don't have to hand-hold the cleanup, it's giving main character energy that handles its own business π
β οΈ not me forgetting this one β the second parameter given to the callback ofnb(val) is"old_state", not the current state. Bestie. Read that twice π The current state can be retrieved by looking at the third parameter (theedevpointer)'s state value. That's where the now lives, iykyk π
Returns 0 if success, or a negative error number if failure π (so like, if you get a negative back, that's a no from the kernel, periodt)
π§ SEE ALSO π§
- Kernel file
./drivers/extcon/devres.c devm_extcon_dev_allocate(9)devm_extcon_dev_free(9)devm_extcon_dev_register(9)devm_extcon_dev_unregister(9)devm_extcon_unregister_notifier(9)devm_extcon_register_notifier_all(9)devm_extcon_unregister_notifier_all(9)
π and that's the whole page bestie! This one lives in the Kernel API Manual, source ./drivers/extcon, dated October 2026 β go slay some notifiers, mwah ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms