Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

serial: rp2: Replace deprecated PCI functions

pcim_iomap_table() and pcim_iomap_regions_request_all() have been
deprecated by the PCI subsystem in commit e354bb84a4c1 ("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/20241030112743.104395-9-pstanner@redhat.com
Signed-off-by: Philipp Stanner <pstanner@redhat.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Jiri Slaby <jirislaby@kernel.org>

authored by

Philipp Stanner and committed by
Bjorn Helgaas
55285d8f 5915997a

+7 -5
+7 -5
drivers/tty/serial/rp2.c
··· 698 698 const struct firmware *fw; 699 699 struct rp2_card *card; 700 700 struct rp2_uart_port *ports; 701 - void __iomem * const *bars; 702 701 int rc; 703 702 704 703 card = devm_kzalloc(&pdev->dev, sizeof(*card), GFP_KERNEL); ··· 710 711 if (rc) 711 712 return rc; 712 713 713 - rc = pcim_iomap_regions_request_all(pdev, 0x03, DRV_NAME); 714 + rc = pcim_request_all_regions(pdev, DRV_NAME); 714 715 if (rc) 715 716 return rc; 716 717 717 - bars = pcim_iomap_table(pdev); 718 - card->bar0 = bars[0]; 719 - card->bar1 = bars[1]; 718 + card->bar0 = pcim_iomap(pdev, 0, 0); 719 + if (!card->bar0) 720 + return -ENOMEM; 721 + card->bar1 = pcim_iomap(pdev, 1, 0); 722 + if (!card->bar1) 723 + return -ENOMEM; 720 724 card->pdev = pdev; 721 725 722 726 rp2_decode_cap(id, &card->n_ports, &card->smpte);