devm_extcon...ter_notifier(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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, okurr
  • edev β€” the extcon device itself, hi bestie πŸ’…
  • id β€” the unique id among the extcon enumeration πŸ”₯ unique queen behavior, no dupes allowed
  • nb β€” 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 of nb (val) is "old_state", not the current state. Bestie. Read that twice 😭 The current state can be retrieved by looking at the third parameter (the edev pointer)'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 🧚


🌈 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