devm_device_add_group(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… devm_device_add_group(9)

okay so bestie, welcome to the Kernel API Manual β€” yes, this is the devm_device_add_group(9) page, and it's lowkey iconic. sit down, grab a strawberry drink πŸ“, and let's get into it.


✨ NAME ✨

devm_device_add_group β€” bestie, you hand it a device, and it makes a managed attribute group for it. that's the whole vibe.


🌸 SYNOPSIS 🌸

int devm_device_add_group (struct device *dev , const struct
       attribute_group *grp );

like, that's the signature. love that for us.


πŸŽ€ ARGUMENTS πŸŽ€

  • dev β€” the device you're creating the group for 🫢
  • grp β€” the attribute group you want to create ✨

πŸ¦‹ DESCRIPTION πŸ¦‹

so this function creates a group for the first time. main character energy, no re-runs.

and it's very much not shy about it: it will explicitly warn and error if any of the attribute files you're trying to create already exist. like, it WILL call you out, in public, no cap. πŸ’€

returns 0 on success, or an error code on failure. simple as that.


πŸ‘‘ SEE ALSO πŸ‘‘

bestie there are a LOT of these and we are not skipping a single one, periodt. kernel file ./drivers/base/core.c, plus:

yeah. that's the group chat. πŸ’œ


ngl bestie, if you're re-adding a group that already exists, expect the warn + error combo. that's not a bug, that's the design, fr fr. πŸ™ˆ

okay that's the whole page!! mwah πŸ’‹ this one's from ./drivers/base, dated October 2026 β€” go off, kernel era. πŸ§šβ€β™€οΈβ­πŸŒˆ

πŸ“¦ where this page comes from