Skip to content

Commit 4996656

Browse files
Philipp Stannerbjorn-helgaas
authored andcommitted
gpio: Replace deprecated PCI functions
pcim_iomap_regions() 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 those functions with calls to pcim_iomap_region(). Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Philipp Stanner <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Acked-by: Bartosz Golaszewski <[email protected]>
1 parent 4365792 commit 4996656

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

drivers/gpio/gpio-merrifield.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,24 +78,25 @@ static int mrfld_gpio_probe(struct pci_dev *pdev, const struct pci_device_id *id
7878
if (retval)
7979
return retval;
8080

81-
retval = pcim_iomap_regions(pdev, BIT(1) | BIT(0), pci_name(pdev));
82-
if (retval)
83-
return dev_err_probe(dev, retval, "I/O memory mapping error\n");
84-
85-
base = pcim_iomap_table(pdev)[1];
81+
base = pcim_iomap_region(pdev, 1, pci_name(pdev));
82+
if (IS_ERR(base))
83+
return dev_err_probe(dev, PTR_ERR(base), "I/O memory mapping error\n");
8684

8785
irq_base = readl(base + 0 * sizeof(u32));
8886
gpio_base = readl(base + 1 * sizeof(u32));
8987

9088
/* Release the IO mapping, since we already get the info from BAR1 */
91-
pcim_iounmap_regions(pdev, BIT(1));
89+
pcim_iounmap_region(pdev, 1);
9290

9391
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
9492
if (!priv)
9593
return -ENOMEM;
9694

9795
priv->dev = dev;
98-
priv->reg_base = pcim_iomap_table(pdev)[0];
96+
priv->reg_base = pcim_iomap_region(pdev, 0, pci_name(pdev));
97+
if (IS_ERR(priv->reg_base))
98+
return dev_err_probe(dev, PTR_ERR(priv->reg_base),
99+
"I/O memory mapping error\n");
99100

100101
priv->pin_info.pin_ranges = mrfld_gpio_ranges;
101102
priv->pin_info.nranges = ARRAY_SIZE(mrfld_gpio_ranges);

0 commit comments

Comments
 (0)