Use the helper to look up the pnv_ioda_pe for the device we're configuring DMA
for. In the VF case there's no need set pdn->pe_number since nothing looks at
it any more.

Signed-off-by: Oliver O'Halloran <ooh...@gmail.com>
---
 arch/powerpc/platforms/powernv/pci-ioda.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c 
b/arch/powerpc/platforms/powernv/pci-ioda.c
index d4b5ee926222..98d858999a2d 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -1709,10 +1709,9 @@ int pnv_pcibios_sriov_enable(struct pci_dev *pdev, u16 
num_vfs)
 
 static void pnv_pci_ioda_dma_dev_setup(struct pnv_phb *phb, struct pci_dev 
*pdev)
 {
-       struct pci_dn *pdn = pci_get_pdn(pdev);
        struct pnv_ioda_pe *pe;
 
-       pe = &phb->ioda.pe_array[pdn->pe_number];
+       pe = pnv_ioda_get_pe(pdev);
        WARN_ON(get_dma_ops(&pdev->dev) != &dma_iommu_ops);
        pdev->dev.archdata.dma_offset = pe->tce_bypass_base;
        set_iommu_table_base(&pdev->dev, pe->table_group.tables[0]);
-- 
2.21.0

Reply via email to