Skip to content

Commit cf43d99

Browse files
Philipp Stannerbjorn-helgaas
authored andcommitted
crypto: marvell - replace deprecated PCI functions
pcim_iomap_table() and pcim_iomap_regions_request_all() have been deprecated by the PCI subsystem in commit e354bb8 ("PCI: Deprecate pcim_iomap_table(), pcim_iomap_regions_request_all()"). Replace these functions with their successors, pcim_iomap() and pcim_request_all_regions(). Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Philipp Stanner <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Acked-by: Bharat Bhushan <[email protected]>
1 parent 86d17af commit cf43d99

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

drivers/crypto/marvell/octeontx2/otx2_cptpf_main.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -739,18 +739,22 @@ static int otx2_cptpf_probe(struct pci_dev *pdev,
739739
dev_err(dev, "Unable to get usable DMA configuration\n");
740740
goto clear_drvdata;
741741
}
742-
/* Map PF's configuration registers */
743-
err = pcim_iomap_regions_request_all(pdev, 1 << PCI_PF_REG_BAR_NUM,
744-
OTX2_CPT_DRV_NAME);
742+
err = pcim_request_all_regions(pdev, OTX2_CPT_DRV_NAME);
745743
if (err) {
746-
dev_err(dev, "Couldn't get PCI resources 0x%x\n", err);
744+
dev_err(dev, "Couldn't request PCI resources 0x%x\n", err);
747745
goto clear_drvdata;
748746
}
749747
pci_set_master(pdev);
750748
pci_set_drvdata(pdev, cptpf);
751749
cptpf->pdev = pdev;
752750

753-
cptpf->reg_base = pcim_iomap_table(pdev)[PCI_PF_REG_BAR_NUM];
751+
/* Map PF's configuration registers */
752+
cptpf->reg_base = pcim_iomap(pdev, PCI_PF_REG_BAR_NUM, 0);
753+
if (!cptpf->reg_base) {
754+
err = -ENOMEM;
755+
dev_err(dev, "Couldn't ioremap PCI resource 0x%x\n", err);
756+
goto clear_drvdata;
757+
}
754758

755759
/* Check if AF driver is up, otherwise defer probe */
756760
err = cpt_is_pf_usable(cptpf);

drivers/crypto/marvell/octeontx2/otx2_cptvf_main.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -358,9 +358,8 @@ static int otx2_cptvf_probe(struct pci_dev *pdev,
358358
dev_err(dev, "Unable to get usable DMA configuration\n");
359359
goto clear_drvdata;
360360
}
361-
/* Map VF's configuration registers */
362-
ret = pcim_iomap_regions_request_all(pdev, 1 << PCI_PF_REG_BAR_NUM,
363-
OTX2_CPTVF_DRV_NAME);
361+
362+
ret = pcim_request_all_regions(pdev, OTX2_CPTVF_DRV_NAME);
364363
if (ret) {
365364
dev_err(dev, "Couldn't get PCI resources 0x%x\n", ret);
366365
goto clear_drvdata;
@@ -369,7 +368,13 @@ static int otx2_cptvf_probe(struct pci_dev *pdev,
369368
pci_set_drvdata(pdev, cptvf);
370369
cptvf->pdev = pdev;
371370

372-
cptvf->reg_base = pcim_iomap_table(pdev)[PCI_PF_REG_BAR_NUM];
371+
/* Map VF's configuration registers */
372+
cptvf->reg_base = pcim_iomap(pdev, PCI_PF_REG_BAR_NUM, 0);
373+
if (!cptvf->reg_base) {
374+
ret = -ENOMEM;
375+
dev_err(dev, "Couldn't ioremap PCI resource 0x%x\n", ret);
376+
goto clear_drvdata;
377+
}
373378

374379
otx2_cpt_set_hw_caps(pdev, &cptvf->cap_flag);
375380

0 commit comments

Comments
 (0)