attribute_c...emove_device(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… NAME

attribute_container_remove_device β€” okay bestie, this one makes a device eligible for removal ✨ like it's basically handing the device its walking papers πŸŽ€


✨ SYNOPSIS

void attribute_container_remove_device (struct device *dev , void
       (*fn)(struct attribute_container *, struct device *, struct device *) );

πŸŽ€ ARGUMENTS

  • dev β€” the generic device, your main character in this whole operation πŸ‘‘
  • fn β€” a function you get to call to remove the device, like your little helper for the deed 🫢

πŸ¦‹ DESCRIPTION

Okay so this routine triggers device removal πŸ”₯ that's the whole vibe, that's the assignment.

If fn is NULL, then it's simply done via device_unregister β€” easy, no extra steps. But (and this is the part where you gotta listen, ngl) if something still has a reference to the classdev, then the memory occupied will not be freed until the classdev is released 😭 like the memory is just sitting there waiting, iconic but also kind of a hostage situation lowkey.

Now, if you want a two phase release β€” you know, remove from visibility and then delete the device β€” then you should use this routine with a fn that calls device_del, and then use attribute_container_device_trigger to do the final put on the classdev. Two steps, two vibes, absolutely slay πŸ’…βœ¨


🌸 SEE ALSO


fr fr that's the whole page, no cap πŸ’œ this lil masterpiece lives in ./drivers/base and it's dated October 2026 β€” go off, kernel docs, you ate 🌈⭐

πŸ“¦ where this page comes from