diff options
author | Oliver O'Halloran <oohall@gmail.com> | 2019-02-15 01:48:15 +0100 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2019-02-21 14:10:14 +0100 |
commit | 67060cb1ffa474c4fa1ae4db865ac1c7ed1fa899 (patch) | |
tree | 79d761c5be8591c0c680f8383a89a886bcbfadbc /arch/powerpc/kernel/pci-common.c | |
parent | powerpc/eeh_cache: Bump log level of eeh_addr_cache_print() (diff) | |
download | linux-67060cb1ffa474c4fa1ae4db865ac1c7ed1fa899.tar.xz linux-67060cb1ffa474c4fa1ae4db865ac1c7ed1fa899.zip |
powerpc/pci: Add pci_find_controller_for_domain()
Add a helper to find the pci_controller structure based on the domain
number / phb id.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Reviewed-by: Sam Bobroff <sbobroff@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/kernel/pci-common.c')
-rw-r--r-- | arch/powerpc/kernel/pci-common.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index cbdf13d86227..60f20c2e559a 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c @@ -351,6 +351,17 @@ struct pci_controller* pci_find_hose_for_OF_device(struct device_node* node) return NULL; } +struct pci_controller *pci_find_controller_for_domain(int domain_nr) +{ + struct pci_controller *hose; + + list_for_each_entry(hose, &hose_list, list_node) + if (hose->global_number == domain_nr) + return hose; + + return NULL; +} + /* * Reads the interrupt pin to determine if interrupt is use by card. * If the interrupt is used, then gets the interrupt line from the |