powernv/pci: Move pnv_pci_dma_bus_setup() to pci-ioda.c
authorOliver O'Halloran <oohall@gmail.com>
Fri, 10 Jan 2020 07:02:07 +0000 (18:02 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 23 Jan 2020 10:31:22 +0000 (21:31 +1100)
This is only used in pci-ioda.c so move it there and rename it to match.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200110070207.439-6-oohall@gmail.com
arch/powerpc/platforms/powernv/pci-ioda.c
arch/powerpc/platforms/powernv/pci.c
arch/powerpc/platforms/powernv/pci.h

index 6755d01eae8ea44863d9c1aca114023e862a0363..22c22cd7bd82eae76349c303229389097d9a70a1 100644 (file)
@@ -3691,9 +3691,29 @@ static void pnv_pci_ioda_shutdown(struct pci_controller *hose)
                       OPAL_ASSERT_RESET);
 }
 
+static void pnv_pci_ioda_dma_bus_setup(struct pci_bus *bus)
+{
+       struct pci_controller *hose = bus->sysdata;
+       struct pnv_phb *phb = hose->private_data;
+       struct pnv_ioda_pe *pe;
+
+       list_for_each_entry(pe, &phb->ioda.pe_list, list) {
+               if (!(pe->flags & (PNV_IODA_PE_BUS | PNV_IODA_PE_BUS_ALL)))
+                       continue;
+
+               if (!pe->pbus)
+                       continue;
+
+               if (bus->number == ((pe->rid >> 8) & 0xFF)) {
+                       pe->pbus = bus;
+                       break;
+               }
+       }
+}
+
 static const struct pci_controller_ops pnv_pci_ioda_controller_ops = {
        .dma_dev_setup          = pnv_pci_ioda_dma_dev_setup,
-       .dma_bus_setup          = pnv_pci_dma_bus_setup,
+       .dma_bus_setup          = pnv_pci_ioda_dma_bus_setup,
        .iommu_bypass_supported = pnv_pci_ioda_iommu_bypass_supported,
        .setup_msi_irqs         = pnv_setup_msi_irqs,
        .teardown_msi_irqs      = pnv_teardown_msi_irqs,
index 36a8fbf6907d8ebaa6e2ee43e0e2033440432b2b..5bf818246339db004fc6c9e317e3d6a9069bb719 100644 (file)
@@ -814,26 +814,6 @@ struct iommu_table *pnv_pci_table_alloc(int nid)
        return tbl;
 }
 
-void pnv_pci_dma_bus_setup(struct pci_bus *bus)
-{
-       struct pci_controller *hose = bus->sysdata;
-       struct pnv_phb *phb = hose->private_data;
-       struct pnv_ioda_pe *pe;
-
-       list_for_each_entry(pe, &phb->ioda.pe_list, list) {
-               if (!(pe->flags & (PNV_IODA_PE_BUS | PNV_IODA_PE_BUS_ALL)))
-                       continue;
-
-               if (!pe->pbus)
-                       continue;
-
-               if (bus->number == ((pe->rid >> 8) & 0xFF)) {
-                       pe->pbus = bus;
-                       break;
-               }
-       }
-}
-
 struct device_node *pnv_pci_get_phb_node(struct pci_dev *dev)
 {
        struct pci_controller *hose = pci_bus_to_host(dev->bus);
index 0cdc9ba1a541d88ceff39f866580f4058a19cbef..d3bbdeab3a32b0f968b923560ae30f25e3f386c5 100644 (file)
@@ -188,7 +188,6 @@ extern void pnv_npu2_map_lpar(struct pnv_ioda_pe *gpe, unsigned long msr);
 extern void pnv_pci_reset_secondary_bus(struct pci_dev *dev);
 extern int pnv_eeh_phb_reset(struct pci_controller *hose, int option);
 
-extern void pnv_pci_dma_bus_setup(struct pci_bus *bus);
 extern int pnv_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type);
 extern void pnv_teardown_msi_irqs(struct pci_dev *pdev);
 extern struct pnv_ioda_pe *pnv_ioda_get_pe(struct pci_dev *dev);