mmc: sdhci-pci: Replace deprecated PCI functions
PATCH 1/1 mmc: sdhci-pci: Replace deprecated PCI functions
pcim_iomap_regions() and pcim_iomap_table() have been deprecated. Replace them with pcim_iomap_region(), which requests and maps a single BAR and returns the mapping directly.
pcim_iomap_region() returns an IOMEM_ERR_PTR() on failure, so check the result with IS_ERR() and propagate the error with ERR_CAST().
--- drivers/mmc/host/sdhci-pci-core.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/mmc/host/sdhci-pci-core.c +3 -5
@@ -2170,14 +2170,12 @@ static struct sdhci_pci_slot *sdhci_pci_probe_slot( host->irq = pdev->irq; - ret =pcim_iomap_regions (pdev,BIT (bar),mmc_hostname (host->mmc)); -if (ret) { + host->ioaddr =pcim_iomap_region (pdev, bar,mmc_hostname (host->mmc)); +if (IS_ERR (host->ioaddr)) {dev_err (&pdev->dev,"cannot request region\n" ); -return ERR_PTR (ret); +return ERR_CAST (host->ioaddr); } - host->ioaddr =pcim_iomap_table (pdev)[bar]; -if (chip->fixes && chip->fixes->probe_slot) { ret = chip->fixes->probe_slot (slot);if (ret)
Signature · 1 line
2.43.0
Quoted 8 lines · Alper Ak
pcim_iomap_regions()andpcim_iomap_table()have been deprecated. Replace them withpcim_iomap_region(), which requests and maps a single BAR and returns the mapping directly.
pcim_iomap_region()returns anIOMEM_ERR_PTR()on failure, so check the result withIS_ERR()and propagate the error withERR_CAST().Signed-off-by Alper Ak <[email protected]>
Quoted 26 lines
--- drivers/mmc/host/sdhci-pci-core.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)drivers/mmc/host/sdhci-pci-core.c +3
-5@@ -2170,14 +2170,12 @@ static struct sdhci_pci_slot *sdhci_pci_probe_slot( host->irq = pdev->irq; - ret =pcim_iomap_regions (pdev,BIT (bar),mmc_hostname (host->mmc)); -if (ret) { + host->ioaddr =pcim_iomap_region (pdev, bar,mmc_hostname (host->mmc)); +if (IS_ERR (host->ioaddr)) {dev_err (&pdev->dev,"cannot request region\n" ); -return ERR_PTR (ret); +return ERR_CAST (host->ioaddr); } - host->ioaddr =pcim_iomap_table (pdev)[bar]; -if (chip->fixes && chip->fixes->probe_slot) { ret = chip->fixes->probe_slot (slot);if (ret)
Quoted 9 lines · Alper Ak
pcim_iomap_regions()andpcim_iomap_table()have been deprecated. Replace them withpcim_iomap_region(), which requests and maps a single BAR and returns the mapping directly.
pcim_iomap_region()returns anIOMEM_ERR_PTR()on failure, so check the result withIS_ERR()and propagate the error withERR_CAST().Signed-off-by Alper Ak <[email protected]>
Applied for next, thanks!
Kind regards
Uffe
Quoted 29 lines
--- drivers/mmc/host/sdhci-pci-core.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)drivers/mmc/host/sdhci-pci-core.c +3
-6@@ -2170,14 +2170,12 @@ static struct sdhci_pci_slot *sdhci_pci_probe_slot( host->irq = pdev->irq; - ret =pcim_iomap_regions (pdev,BIT (bar),mmc_hostname (host->mmc)); -if (ret) { + host->ioaddr =pcim_iomap_region (pdev, bar,mmc_hostname (host->mmc)); +if (IS_ERR (host->ioaddr)) {dev_err (&pdev->dev,"cannot request region\n" ); -return ERR_PTR (ret); +return ERR_CAST (host->ioaddr); } - host->ioaddr =pcim_iomap_table (pdev)[bar]; -if (chip->fixes && chip->fixes->probe_slot) { ret = chip->fixes->probe_slot (slot);if (ret) --2.43.0