fwnode_conne...find_matches(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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, okurrr
  • data β€” 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 ngl
  • matches β€” (optional!) an array of pointers you fill with the matches. lowkey optional, we love flexibility
  • matches_len β€” the length of matches. 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:

reading arrays and strings (device_ flavoured):

reading arrays and strings (fwnode_ flavoured, yes it's its own era):

references:

names, because identity matters:

parents and the family tree 🌳:

children, the next generation:

handles and availability checks:

phys modes:

iomap + irqs (hardware girlie stuff πŸ”₯):

the whole graph saga, endpoints and ports and parents oh my:

and the sibling entry in this very saga:


lowkey a reminder bestie: matches being NULL isn'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