fwnode_conne...find_matches(9)
π fwnode_conne...find_matches(9) π
ok so this is a Kernel API Manual page (yes the whole Linux kernel has manpages, we stay educated π) and today's main character is fwnode_connection_find_matches β the little function that goes "hey bestie, what connections does this device node have?" and actually finds them. periodt.
β¨ NAME β¨
fwnode_connection_find_matches β Find connections from a device node π¦
πΈ SYNOPSIS πΈ
int fwnode_connection_find_matches (const struct fwnode_handle *fwnode ,
const char *con_id , void *data , devcon_match_fn_t match , void
**matches , unsigned int matches_len );
like, that's the whole signature, no cap π
π ARGUMENTS π
fwnodeβ the device node that's holding the connection, the vibe source, the one we're snooping around in πcon_idβ the identifier for the connection. it's the name-tag, okurrrdataβ the data that gets handed to the match function. it's giving "here's your lunch, go do your thing" πmatchβ the function that checks and converts the connection description. it's the icon doing the actual work nglmatchesβ (optional!) an array of pointers you fill with the matches. lowkey optional, we love flexibilitymatches_lenβ the length ofmatches. yes it's just how many slots you gave it π
π¦ DESCRIPTION π¦
okay so what this does: it finds up to matches_len connections that have the unique identifier con_id, between fwnode and other device nodes. so like, a little matchmaking service but for kernel data structures π
match is the one that converts the connection description into the data the caller is expecting to get back β and that converted stuff comes back to you through the matches array. that's the whole pipeline bestie, no notes β¨
and here's the fun little plot twist: if matches is NULL, then matches_len is straight-up ignored π, and instead you get the total number of resolved matches returned. iykyk.
π RETURN π
the number of matches resolved π β or a negative errno if things went sideways π (classic kernel behaviour, we respect it)
π SEE ALSO π
the kernel file is ./drivers/base/property.c β that's where the magic lives, go read it, it's iconic β¨
and bc we're thorough and we don't skip a single one of these, here's the full squad of related functions, grouped so your brain doesn't melt π§:
property presence / bools:
device_property_present(9)fwnode_property_present(9)device_property_read_bool(9)fwnode_property_read_bool(9)
reading arrays and strings (device_ flavoured):
device_property_read_u8_array(9)device_property_read_u16_array(9)device_property_read_u32_array(9)device_property_read_u64_array(9)device_property_read_string_array(9)device_property_read_string(9)device_property_match_string(9)
reading arrays and strings (fwnode_ flavoured, yes it's its own era):
fwnode_property_read_u8_array(9)fwnode_property_read_u16_array(9)fwnode_property_read_u32_array(9)fwnode_property_read_u64_array(9)fwnode_property_read_string_array(9)fwnode_property_read_string(9)fwnode_property_match_string(9)fwnode_property_match_property_string(9)
references:
names, because identity matters:
parents and the family tree π³:
children, the next generation:
fwnode_get_next_child_node(9)fwnode_get_next_available_child_node(9)device_get_next_child_node(9)fwnode_get_named_child_node(9)device_get_named_child_node(9)fwnode_get_child_node_count(9)fwnode_get_named_child_node_count(9)
handles and availability checks:
phys modes:
iomap + irqs (hardware girlie stuff π₯):
the whole graph saga, endpoints and ports and parents oh my:
fwnode_graph_get_next_endpoint(9)fwnode_graph_get_port_parent(9)fwnode_graph_get_remote_port_parent(9)fwnode_graph_get_remote_port(9)fwnode_graph_get_remote_endpoint(9)fwnode_graph_get_endpoint_by_id(9)fwnode_graph_get_endpoint_count(9)fwnode_graph_parse_endpoint(9)
and the sibling entry in this very saga:
lowkey a reminder bestie:matchesbeingNULLisn't an error, it's just a "count only" mode. don't come for me, that's literally what the page says π
ok that's the whole thing, you ate that π«Ά this page lives in ./drivers/base and it's dated October 2026 β literally from the future, main character energy only πβ¨π
π¦ 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