devm_of_pci...ge_resources(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

devm_of_pci_get_host_bridge_resources β€” the resource-managed way to parse PCI host bridge resources straight out of DT πŸ’… (this page lives in the Kernel API Manual, iykyk)


🌸 SYNOPSIS 🌸

int devm_of_pci_get_host_bridge_resources (struct device *dev , struct
list_head *resources , struct list_head *ib_resources , resource_size_t
*io_base );

okay so that's the whole vibe right there, bestie β€” one function, four args, let's get into it 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • dev β€” the host bridge device, aka the main character here πŸ‘‘
  • resources β€” the list where the range of resources gets added after DT parsing ✨
  • ib_resources β€” the list where the range of inbound resources gets added after DT parsing, and yes those addresses come from 'dma-ranges' πŸ’–
  • io_base β€” a pointer to a variable that will hold, on return, the physical address where the I/O range starts. It can be NULL if the caller genuinely doesn't expect I/O ranges to be hanging out in the device tree πŸ™ˆ (no cap, that's allowed)

πŸ¦‹ DESCRIPTION πŸ¦‹

So what does it actually do? It parses the "ranges" property of a PCI host bridge device node and sets up the resource mapping based on what's in there. Lowkey iconic. It's expected that the property conforms with the Power ePAPR document β€” like, that's the standard it's matching against, fr fr πŸ“„

It returns zero if the range parsing has been successful, or a standard error value if it failed. That's the whole return situation, periodt πŸ’€


πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./drivers/pci/of.c β€” and these besties right here:


and that's the page, bestie πŸ’œ it's from ./drivers/pci, dated October 2026, and it's literally called devm_of_pci...ge_resources(9) β€” go forth and parse those ranges 🌈⭐

πŸ“¦ where this page comes from