fwnode_grap...dpoint_by_id(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… fwnode_grap...dpoint_by_id(9) πŸ’…

okay so bestie, welcome to the Kernel API Manual β€” yes that's the whole manual name, we're in the big leagues now πŸŽ€ β€” and today's main character is fwnode_graph_get_endpoint_by_id. Let's get into it, no cap.


✨ NAME ✨

fwnode_graph_get_endpoint_by_id β€” literally just "get endpoint by port and endpoint numbers" πŸ’– like it says on the tin, she's not hiding anything.


🌸 SYNOPSIS 🌸

struct fwnode_handle * fwnode_graph_get_endpoint_by_id (const struct
fwnode_handle *fwnode , u32 port , u32 endpoint , unsigned long flags );

that's the whole signature, copy it exactly, don't get creative with it πŸ™ˆ


πŸ¦‹ ARGUMENTS πŸ¦‹

  • fwnode β€” the parent fwnode_handle that's holding the graph, aka the whole friend group this endpoint lives in 🫢
  • port β€” the identifier of the port node, so like which port we're sliding into (respectfully) πŸ’…
  • endpoint β€” the identifier of the endpoint node sitting under that port node, the actual one you want πŸ‘‘
  • flags β€” the fwnode lookup flags, the little switches that change how the search behaves ⭐

πŸ”₯ DESCRIPTION πŸ”₯

first things first, and this is important so listen up: the caller is responsible for calling fwnode_handle_put on the returned fwnode pointer. that's on you, bestie, not on the function. cleanup is your job 🧹✨

now, the cute part. if FWNODE_GRAPH_ENDPOINT_NEXT is passed in flags and the endpoint you asked for hasn't been found, she doesn't just give up β€” she goes looking for the closest endpoint ID greater than the specified one and returns the endpoint that corresponds to it, if present. it's giving "next best thing" energy πŸ’–

and here's the vibe check: she does not return endpoints that belong to disabled devices, or endpoints that are unconnected β€” unless, that is, FWNODE_GRAPH_DEVICE_DISABLED is passed in flags. then the doors open πŸšͺ✨


πŸ‘‘ RETURN πŸ‘‘

she returns the fwnode handle of the local endpoint corresponding to your port and endpoint IDs 🎯 …or NULL if it's not found 😭 that's it, that's the whole deal.


🌈 SEE ALSO 🌈

the whole extended universe, fr fr β€” starting with the kernel file ./drivers/base/property.c:


πŸ’œ okay that's the whole page, go read the graph code, and don't forget the fwnode_handle_put or I will find out 🫢

and that's a wrap, babe πŸ’… this little masterpiece lives in ./drivers/base and it's stamped October 2026 β€” slay, iconic, periodt βœ¨πŸŒΈπŸ¦‹

πŸ“¦ where this page comes from