of_reserved...ource_byname(9)
π NAME π
of_reserved_mem_region_to_resource_byname β okay so this one grabs a reserved memory region and hands it back to you as a resource, bestie β¨
This page lives in the Kernel API Manual, and the function it's hyping up is literally called of_reserved...ource_byname(9) (yes the name is a whole mood, we don't question it) π
πΈ SYNOPSIS πΈ
int of_reserved_mem_region_to_resource_byname (const struct device_node
*np , const char *name , struct resource *res );
π¦ ARGUMENTS π¦
npβ the node that's holding the'memory-region'property. like, the one carrying the goods πnameβ the name of the'memory-region'property entry you wanna look up. it's giving "which one tho" π§resβ a pointer to astruct resourcethat gets filled in with the reserved region. she's the vessel, she gets filled, we love her π«Ά
β¨ DESCRIPTION β¨
So here's the vibe: this function lets drivers look up a node's 'memory-region' property entries by name, and then it hands you back a struct resource for whichever entry you asked for. no cap, that's the whole thing π
It returns 0 on success, with res filled in β iconic behaviour π β or a negative error-code on failure. so yeah, check your return values, bestie, this is not the place to be asleep π
π SEE ALSO π
Kernel file: ./drivers/of/of_reserved_mem.c
fdt_scan_reserved_mem_late(9)fdt_fixup_reserved_mem_node(9)fdt_validate_reserved_mem_node(9)__reserved_mem_init_node(9)fdt_init_reserved_mem_node(9)of_reserved_mem_device_init_by_idx(9)of_reserved_mem_device_init_by_name(9)of_reserved_mem_device_release(9)devm_of_reserved_mem_device_init(9)of_reserved_mem_lookup(9)of_reserved_mem_region_to_resource(9)of_reserved_mem_region_count(9)
quick reminder thatresonly means anything when the return is0, so likeβ¦ actually look at the return code before you go dereferencing anything, i'm begging π
and that's the page, bestie!! π this little baddie comes to you from ./drivers/of, dated October 2026, and it answers to the name of_reserved...ource_byname(9) β go off, you beautiful truncated legend πβ¨π
π¦ 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