Skip to content

Commit 09db69a

Browse files
William Breathitt GrayBartosz Golaszewski
authored andcommitted
gpio: pcie-idio-24: Replace deprecated PCI functions
pcim_iomap_regions() and pcim_iomap_table() have been deprecated in commit e354bb8 ("PCI: Deprecate pcim_iomap_table(), pcim_iomap_regions_request_all()"). Replace these functions with pcim_iomap_region(). In order to match the rest of the code in idio_24_probe(), utilize dev_err_probe() to handle error for pcim_enable_device(). Signed-off-by: William Breathitt Gray <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Link: https://lore.kernel.org/r/20241101-pci_iomap_region_gpio_acces-v1-2-26eb1dc93e45@kernel.org Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent aeca175 commit 09db69a

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

drivers/gpio/gpio-pcie-idio-24.c

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -305,19 +305,16 @@ static int idio_24_probe(struct pci_dev *pdev, const struct pci_device_id *id)
305305
struct regmap_irq_chip_data *chip_data;
306306

307307
err = pcim_enable_device(pdev);
308-
if (err) {
309-
dev_err(dev, "Failed to enable PCI device (%d)\n", err);
310-
return err;
311-
}
308+
if (err)
309+
return dev_err_probe(dev, err, "Failed to enable PCI device\n");
312310

313-
err = pcim_iomap_regions(pdev, BIT(pci_plx_bar_index) | BIT(pci_bar_index), name);
314-
if (err) {
315-
dev_err(dev, "Unable to map PCI I/O addresses (%d)\n", err);
316-
return err;
317-
}
311+
pex8311_regs = pcim_iomap_region(pdev, pci_plx_bar_index, "pex8311");
312+
if (IS_ERR(pex8311_regs))
313+
return dev_err_probe(dev, PTR_ERR(pex8311_regs), "Unable to map PEX 8311 I/O addresses\n");
318314

319-
pex8311_regs = pcim_iomap_table(pdev)[pci_plx_bar_index];
320-
idio_24_regs = pcim_iomap_table(pdev)[pci_bar_index];
315+
idio_24_regs = pcim_iomap_region(pdev, pci_bar_index, name);
316+
if (IS_ERR(idio_24_regs))
317+
return dev_err_probe(dev, PTR_ERR(idio_24_regs), "Unable to map PCIe-IDIO-24 I/O addresses\n");
321318

322319
intcsr_map = devm_regmap_init_mmio(dev, pex8311_regs, &pex8311_intcsr_regmap_config);
323320
if (IS_ERR(intcsr_map))

0 commit comments

Comments
 (0)