• Gavin Shan's avatar
    powerpc/pci: Refactor pci_dn · cca87d30
    Gavin Shan authored
    Currently, the PCI config accessors are implemented based on device node.
    Unfortunately, SRIOV VFs won't have the corresponding device nodes. pci_dn
    will be used in replacement with device node for SRIOV VFs. So we have to
    use pci_dn in PCI config accessors.
    
    The patch refactors pci_dn in following aspects to make it ready to be used
    in PCI config accessors as we do in subsequent patch:
    
       * pci_dn is organized as a hierarchy tree.  PCI device's pci_dn is
         put to the child list of pci_dn of its upstream bridge or PHB. VF's
         pci_dn will be put to the child list of pci_dn of PF's bridge.
    
       * For one particular PCI device (VF or not), its pci_dn can be
         found from pdev->dev.archdata.pci_data, PCI_DN(devnode), or
         parent's list.  The fast path (fetching pci_dn through PCI device
         instance) is populated during early fixup time.
    
    [bhelgaas: changelog]
    Signed-off-by: default avatarGavin Shan <gwshan@linux.vnet.ibm.com>
    Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
    cca87d30
device.h 1.05 KB