Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

crypto: marvell - replace deprecated PCI functions

pcim_iomap_table() and pcim_iomap_regions_request_all() have been
deprecated by the PCI subsystem in commit e354bb84a4c1 ("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/20241030112743.104395-5-pstanner@redhat.com
Signed-off-by: Philipp Stanner <pstanner@redhat.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Bharat Bhushan <bbhushan2@marvell.com>

authored by

Philipp Stanner and committed by
Bjorn Helgaas
cf43d998 86d17afd

+18 -9
+9 -5
drivers/crypto/marvell/octeontx2/otx2_cptpf_main.c
··· 739 739 dev_err(dev, "Unable to get usable DMA configuration\n"); 740 740 goto clear_drvdata; 741 741 } 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); 745 743 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); 747 745 goto clear_drvdata; 748 746 } 749 747 pci_set_master(pdev); 750 748 pci_set_drvdata(pdev, cptpf); 751 749 cptpf->pdev = pdev; 752 750 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 + } 754 758 755 759 /* Check if AF driver is up, otherwise defer probe */ 756 760 err = cpt_is_pf_usable(cptpf);
+9 -4
drivers/crypto/marvell/octeontx2/otx2_cptvf_main.c
··· 358 358 dev_err(dev, "Unable to get usable DMA configuration\n"); 359 359 goto clear_drvdata; 360 360 } 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); 364 363 if (ret) { 365 364 dev_err(dev, "Couldn't get PCI resources 0x%x\n", ret); 366 365 goto clear_drvdata; ··· 368 369 pci_set_drvdata(pdev, cptvf); 369 370 cptvf->pdev = pdev; 370 371 371 - cptvf->reg_base = pcim_iomap_table(pdev)[PCI_PF_REG_BAR_NUM]; 372 + /* Map VF's configuration registers */ 373 + cptvf->reg_base = pcim_iomap(pdev, PCI_PF_REG_BAR_NUM, 0); 374 + if (!cptvf->reg_base) { 375 + ret = -ENOMEM; 376 + dev_err(dev, "Couldn't ioremap PCI resource 0x%x\n", ret); 377 + goto clear_drvdata; 378 + } 372 379 373 380 otx2_cpt_set_hw_caps(pdev, &cptvf->cap_flag); 374 381