scmi_alloc_...col_instance(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– scmi_alloc_init_protocol_instance β€” the allocate-and-glow-up page πŸ’–

okay so bestie, you're reading scmi_alloc_...col_instance(9) straight out of the Kernel API Manual (section 9, we love a numbered section πŸŽ€), and honestly? it's giving "tiny function, huge responsibilities." Let's get into it ✨


✨ NAME ✨

scmi_alloc_init_protocol_instance β€” allocate and initialize a protocol instance descriptor. that's it, that's the whole vibe πŸ¦‹


🌸 SYNOPSIS 🌸

struct scmi_protocol_instance * scmi_alloc_init_protocol_instance
(struct scmi_info *info , const struct scmi_protocol *proto );

yes the spacing is exactly like that, don't @ me, it's C 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • info β€” the reference to the related SCMI instance. like, which SCMI are we talking about, babes πŸ’…
  • proto β€” the protocol descriptor. the blueprint, the blueprintiest blueprint πŸ‘‘

πŸ’œ DESCRIPTION πŸ’œ

so what this does is: it allocates a brand-new protocol instance descriptor, using the proto description you handed it, against the specified SCMI instance info, and then it initializes it. lowkey iconic.

and here's the slay part β€” all resources management is handled via a dedicated per-protocol devres group. like everything's cleanup-managed per protocol, tidy, organized, main character energy fr fr 🧚


🌈 CONTEXT 🌈

⚠️ it assumes it's being called with protocols_mtx already acquired. so like... acquire your mutex first, bestie, or it's not gonna be cute 😭

⭐ RETURN ⭐

it returns a reference to a freshly allocated and initialized protocol instance β€” a whole new baby, born shimmery ✨

or it returns ERR_PTR on failure πŸ’€. and on failure, the proto reference is at first put using scmi_protocol_put before releasing all the devres group. order matters, no cap πŸ”₯


πŸ¦‹ SEE ALSO πŸ¦‹

the whole friend group πŸ’– (yes, all of them, i'm not leaving anyone out):


okay that's the whole page, you ate that πŸ’…πŸ’– go forth and allocate responsibly. this came from ./drivers/firmware/arm_scmi, dated October 2026 β€” mark your calendars bestie, it's an icon, it's a legend, it's a kernel API manual page πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from