component_match_add_typed(9)
π 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 bymatchptrmust be initialized toNULLbefore 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 π
- Kernel file
./drivers/base/component.coverview(9) component_compare_of(9)component_release_of(9)component_compare_dev(9)component_compare_dev_name(9)component_match_add_release(9)component_master_add_with_match(9)component_master_del(9)component_unbind_all(9)component_bind_all(9)component_add_typed(9)component_add(9)component_del(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms