component_match_add_typed(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… component_match_add_typed(9) β€” from the Kernel API Manual, bestie

okay so picture this: you're deep in ./drivers/base territory, the Kernel API Manual is open, and you need to add a match entry for a typed component. That's literally this page. Let's go πŸŽ€


✨ NAME ✨

component_match_add_typed β€” adds a component match entry for a typed component πŸ¦‹


🌸 SYNOPSIS 🌸

void component_match_add_typed (struct device *parent , struct
component_match **matchptr , int (*compare_typed)(struct device *, int,
void *) , void *compare_data );

no cap, that's the whole signature. she's a void, she returns nothing, she simply does the thing πŸ’…


🫢 ARGUMENTS 🫢

  • parent β€” the parent device of the aggregate driver. the main character device, basically πŸ‘‘
  • matchptr β€” pointer to the list of component matches. this is the list you're feeding πŸ“‹
  • compare_typed β€” compare function to match against all typed components. every single one, fr fr πŸ”
  • compare_data β€” an opaque pointer that gets passed straight to the compare function. literally opaque, don't ask her what's inside πŸ™ˆ

⭐ DESCRIPTION ⭐

So what does she actually do? She adds a new component match to the list stored in matchptr β€” the list that the aggregate driver needs to function. Iconic behaviour.

🚨 important vibe check: the list of component matches pointed to by matchptr must be initialized to NULL before you add the first match. Do not skip this. This is not optional, bestie 😭

Also key: this only matches against components added with component_add_typed. So if you added them some other way, this is not the function for you, iykyk.

And the good news? The allocated match list in matchptr is automatically released using devm actions. she cleans up after herself, we love a self-sufficient queen ✨

See also component_match_add_release and component_match_add_typed. (yes, she's on her own see-also list, that's just main character energy πŸŽ€)


🌈 SEE ALSO 🌈


and that's the page, bestie πŸ§šπŸ’– this one lives over in ./drivers/base and the manual's stamped October 2026 β€” go forth and match some typed components, you've absolutely got this πŸ«ΆπŸ“πŸ‘‘

πŸ“¦ where this page comes from