of_address_to_resource(9)
okay so bestie, welcome to of_address_to_resource(9) from the Kernel API Manual β the function that translates a device tree address and returns it as a resource. literally iconic behavior. β¨π
πΈ NAME πΈ
of_address_to_resource β translate device tree address and return as resource. periodt. π
β¨ SYNOPSIS β¨
int of_address_to_resource (struct device_node *dev , int index , struct
resource *r );
π«Ά ARGUMENTS π«Ά
devβ Caller's Device Node. like, the device node you're rolling up with. π¦indexβ Index into the array. pick your fave entry, no cap. β¨rβ Pointer to resource array. this is where the resource is gonna land. π
π DESCRIPTION π
Returns -EINVAL if the range cannot be converted to resource. yep, that's the error you get when the conversion just refuses to slay. π
Note that if your address is a PIO address, the conversion will fail if the physical address can't be internally converted to an IO token with pci_address_to_pio, that is because it's either called too early or it can't be matched to any host bridge IO space. π this is the part where you go "not me calling it too early" β fr fr.
π¦ SEE ALSO π¦
- Kernel file
./drivers/of/address.c of_translate_dma_region(9)of_property_read_reg(9)of_dma_get_range(9)of_dma_get_max_cpu_address(9)of_dma_is_coherent(9)of_mmio_is_nonposted(9)of_iomap(9)
signed off by ./drivers/of Β· October 2026 Β· of_address_to_resource(9) β mwah, slay, bye bestie πππ
π¦ 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