dev_err(dev, "I/O range found for %pOF. Please provide an io_base pointer to save CPU base address\n",
#define pr_fmt(fmt) "PCI: OF: " fmt
#include <linux/irqdomain.h>
#include <linux/kernel.h>
#include <linux/of_irq.h>
#include <linux/of_address.h>
#include <linux/of_pci.h>
void pci_set_of_node(struct pci_dev *dev)
if (!dev->bus->dev.of_node)
dev->dev.of_node = of_pci_find_child_device(dev->bus->dev.of_node,
void pci_release_of_node(struct pci_dev *dev)
of_node_put(dev->dev.of_node);
void pci_set_bus_of_node(struct pci_bus *bus)
bus->dev.of_node = pcibios_get_phb_of_node(bus);
bus->dev.of_node = of_node_get(bus->self->dev.of_node);
void pci_release_bus_of_node(struct pci_bus *bus)
of_node_put(bus->dev.of_node);
struct device_node * __weak pcibios_get_phb_of_node(struct pci_bus *bus)
if (WARN_ON(bus->self || bus->parent))
if (bus->bridge->of_node)
return of_node_get(bus->bridge->of_node);
if (bus->bridge->parent && bus->bridge->parent->of_node)
return of_node_get(bus->bridge->parent->of_node);