fdt_get_property(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

okay bestie, this is fdt_get_property(9) from the Kernel API Manual β€” and the whole vibe is: fdt_get_property β€” find a given property in a given node. periodt πŸ’…


✨ SYNOPSIS ✨

const struct fdt_property * fdt_get_property (const void *fdt , int
nodeoffset , const char *name , int *lenp );

πŸŽ€ ARGUMENTS πŸŽ€

  • fdt β€” pointer to the device tree blob, aka the whole tree bestie 🫢
  • nodeoffset β€” offset of the node whose property to find ✨
  • name β€” name of the property to find, literally the string we're hunting πŸ”
  • lenp β€” pointer to an integer variable (will be overwritten) or NULL β€” yes, it gets overwritten, don't be shocked πŸ’€

🌸 DESCRIPTION 🌸

okay so fdt_get_property retrieves a pointer to the fdt_property structure within the device tree blob corresponding to the property named 'name' of the node at offset nodeoffset. If lenp is non-NULL, the length of the property value is also returned, in the integer pointed to by lenp. that's the whole quest, bestie 🧚✨


πŸ”₯ RETURN πŸ”₯

here's the return tea β˜•οΈ:

  • on success: pointer to the structure representing the property β€” if lenp is non-NULL, *lenp contains the length of the property value (>=0) πŸ’–
  • NULL, on error β€” if lenp is non-NULL, *lenp contains an error code (<0):
    • -FDT_ERR_NOTFOUND β€” node does not have named property
    • -FDT_ERR_BADOFFSET β€” nodeoffset did not point to FDT_BEGIN_NODE tag
    • -FDT_ERR_BADMAGIC, -FDT_ERR_BADVERSION, -FDT_ERR_BADSTATE, -FDT_ERR_BADSTRUCTURE, -FDT_ERR_TRUNCATED β€” standard meanings
heads up bestie: if you pass lenp, it absolutely gets overwritten. that's not a drill πŸ’…

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file: ./scripts/dtc/libfdt/libfdt.h

the whole fdt bestie squad is here, no cap:


and that's the tea β˜•οΈ β€” this iconic lil page lives in ./scripts/dtc/libfdt, dated October 2026, and it's still serving fdt_get_property(9) realness. mwah πŸ’‹

πŸ“¦ where this page comes from