Skip to content

Commit bdcddd0

Browse files
Philipp Stannerbjorn-helgaas
authored andcommitted
ata: ahci: Replace deprecated PCI functions
pcim_iomap_regions_request_all() and pcim_iomap_table() 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: Damien Le Moal <[email protected]>
1 parent d9d959c commit bdcddd0

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

drivers/ata/acard-ahci.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ static int acard_ahci_init_one(struct pci_dev *pdev, const struct pci_device_id
370370
/* AHCI controllers often implement SFF compatible interface.
371371
* Grab all PCI BARs just in case.
372372
*/
373-
rc = pcim_iomap_regions_request_all(pdev, 1 << AHCI_PCI_BAR, DRV_NAME);
373+
rc = pcim_request_all_regions(pdev, DRV_NAME);
374374
if (rc == -EBUSY)
375375
pcim_pin_device(pdev);
376376
if (rc)
@@ -386,7 +386,9 @@ static int acard_ahci_init_one(struct pci_dev *pdev, const struct pci_device_id
386386
if (!(hpriv->flags & AHCI_HFLAG_NO_MSI))
387387
pci_enable_msi(pdev);
388388

389-
hpriv->mmio = pcim_iomap_table(pdev)[AHCI_PCI_BAR];
389+
hpriv->mmio = pcim_iomap(pdev, AHCI_PCI_BAR, 0);
390+
if (!hpriv->mmio)
391+
return -ENOMEM;
390392

391393
/* save initial config */
392394
ahci_save_initial_config(&pdev->dev, hpriv);

drivers/ata/ahci.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1869,7 +1869,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
18691869
/* AHCI controllers often implement SFF compatible interface.
18701870
* Grab all PCI BARs just in case.
18711871
*/
1872-
rc = pcim_iomap_regions_request_all(pdev, 1 << ahci_pci_bar, DRV_NAME);
1872+
rc = pcim_request_all_regions(pdev, DRV_NAME);
18731873
if (rc == -EBUSY)
18741874
pcim_pin_device(pdev);
18751875
if (rc)
@@ -1893,7 +1893,9 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
18931893
if (ahci_sb600_enable_64bit(pdev))
18941894
hpriv->flags &= ~AHCI_HFLAG_32BIT_ONLY;
18951895

1896-
hpriv->mmio = pcim_iomap_table(pdev)[ahci_pci_bar];
1896+
hpriv->mmio = pcim_iomap(pdev, ahci_pci_bar, 0);
1897+
if (!hpriv->mmio)
1898+
return -ENOMEM;
18971899

18981900
/* detect remapped nvme devices */
18991901
ahci_remap_check(pdev, ahci_pci_bar, hpriv);

0 commit comments

Comments
 (0)