]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mmc: dw_mmc-pci: Use BAR_2 and pcim_iomap_region()
authorShawn Lin <shawn.lin@rock-chips.com>
Tue, 6 Jan 2026 02:17:07 +0000 (10:17 +0800)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 23 Feb 2026 11:06:54 +0000 (12:06 +0100)
PCIe endpoint framework defines standard BAR enum for EP drivers
to use, so remove PCI_BAR_NO here.

Then, pcim_iomap_regions has been deprecated for a long time, replace
it with pcim_iomap_region();

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/dw_mmc-pci.c

index c82c23e4ea9a0c657a2fe1ae0961681059786243..66d2edc30600919746b978f720f8c8118ed3930e 100644 (file)
 #include <linux/io.h>
 #include <linux/irq.h>
 #include <linux/pci.h>
+#include <linux/pci-epf.h>
 #include <linux/pm_runtime.h>
 #include <linux/slab.h>
 #include <linux/mmc/host.h>
 #include <linux/mmc/mmc.h>
 #include "dw_mmc.h"
 
-#define PCI_BAR_NO 2
 #define SYNOPSYS_DW_MCI_VENDOR_ID 0x700
 #define SYNOPSYS_DW_MCI_DEVICE_ID 0x1107
 /* Defining the Capabilities */
@@ -49,11 +49,9 @@ static int dw_mci_pci_probe(struct pci_dev *pdev,
        host->bus_hz = 33 * 1000 * 1000;
        host->drv_data = &pci_drv_data;
 
-       ret = pcim_iomap_regions(pdev, 1 << PCI_BAR_NO, pci_name(pdev));
-       if (ret)
-               return ret;
-
-       host->regs = pcim_iomap_table(pdev)[PCI_BAR_NO];
+       host->regs = pcim_iomap_region(pdev, BAR_2, pci_name(pdev));
+       if (IS_ERR(host->regs))
+               return PTR_ERR(host->regs);
 
        pci_set_master(pdev);