of_address_to_resource(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

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 πŸ¦‹


signed off by ./drivers/of Β· October 2026 Β· of_address_to_resource(9) β€” mwah, slay, bye bestie πŸ’‹πŸ’–πŸŒˆ

πŸ“¦ where this page comes from