fdt_get_property_by_offset(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… fdt_get_property_by_offset(9) β€” Kernel API Manual, but make it cute ✨

okay bestie, welcome to the Kernel API Manual page for fdt_get_property_by_offset(9) β€” yes that's the whole name, she's long, she's iconic, we love her πŸ’–


πŸŽ€ NAME

fdt_get_property_by_offset β€” retrieve the property at a given offset ✨


πŸ¦‹ SYNOPSIS

const struct fdt_property * fdt_get_property_by_offset (const void *fdt
, int offset , int *lenp );

that's the whole vibe, no cap 🫢


🌸 ARGUMENTS

  • fdt β€” pointer to the device tree blob, aka the thing you're digging around in 🌈
  • offset β€” offset of the property you wanna retrieve, like the exact address of the cutest item in the shop πŸ’…
  • lenp β€” pointer to an integer variable (will be overwritten, bestie, warned you 😭) or NULL

πŸ’œ DESCRIPTION

so fdt_get_property_by_offset retrieves a pointer to the fdt_property structure within the device tree blob at the given offset. simple as that, main character energy πŸ‘‘

and if lenp is non-NULL, the length of the property value is also returned, in the integer pointed to by lenp. two-for-one deal, ate πŸ’…

🚨 little note before you go off: this code only works on device tree versions >= 16. literally only those. fdt_getprop works on all versions, so if you're on an old blob, that's your girl ✨

πŸ”₯ RETURN

here's the tea, and there's two branches so pay attention πŸ“

  • pointer to the structure representing the property β€” and if lenp is non-NULL, *lenp contains the length of the property value (>=0) πŸŽ€
  • NULL on error β€” and if lenp is non-NULL, *lenp contains an error code (<0), like:
    • -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_PROP tag πŸ’€
    • -FDT_ERR_BADMAGIC
    • -FDT_ERR_BADVERSION
    • -FDT_ERR_BADSTATE
    • -FDT_ERR_BADSTRUCTURE
    • -FDT_ERR_TRUNCATED

all the standard meanings, iykyk 🧚


🌈 SEE ALSO

okay this is the part where the whole group chat gets tagged 😭 β€” kernel file ./scripts/dtc/libfdt/libfdt.h and literally all of these:

like I said. everybody. the entire function family reunion πŸ«ΆπŸŽ€


and that's the page!! this one lives in ./scripts/dtc/libfdt, dated October 2026, and it's literally the fdt_get_property_by_offset(9) manual β€” go be great with it bestie πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from