attribute_c...trigger_safe(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… attribute_container_device_trigger_safe β€” Kernel API Manual (section 9)

okay so bestie, buckle in, because this one is genuinely a safety girlie and we stan her for it πŸŽ€


✨ NAME ✨

attribute_container_device_trigger_safe β€” run a trigger for every matching classdev, or make the whole thing fail for all of them. no halfsies. it's giving all-or-nothing energy πŸ‘‘


πŸ¦‹ SYNOPSIS πŸ¦‹

int attribute_container_device_trigger_safe (struct device *dev , int
(*fn)(struct attribute_container *, struct device *, struct device *) ,
int (*undo)(struct attribute_container *, struct device *, struct device
*) );

like yes, those function pointers are lowkey a mouthful, but look at her, she's iconic πŸ’œ


🌸 ARGUMENTS 🌸

  • dev β€” the generic device you're running the trigger for. the main character of this whole operation ✨
  • fn β€” the function to execute for each classdev. this is the do-the-thing callback, fr fr.
  • undo β€” a function to undo the work that was previously done, in case of error. she's the cleanup crew, the ride-or-die, the "we can fix this" bestie 🫢

πŸ’– DESCRIPTION πŸ’–

okay so here's the tea: this function is the safe version of attribute_container_device_trigger. πŸŽ€

It stops on the very first error, and then it undoes the partial work that had been done on the previous classdev. so nothing's just left sitting around in a weird half-finished state, no ma'am πŸ™ˆ

and the guarantee? it's guaranteed that either they all succeeded, or none of them succeeded. periodt. atomic queen behaviour, no cap πŸ’…

ngl, that all-or-nothing guarantee is the whole point of picking this one over the plain trigger β€” if you want the risky vibe, that's a different function, iykyk 😭

🧚 SEE ALSO 🧚


and that's the whole page bestie, you ate that πŸ’–βœ¨

shoutout to ./drivers/base for housing all this goodness, and this little cutie is dated October 2026 β€” slay 🌈⭐

πŸ“¦ where this page comes from