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

Configure Feed

Select the types of activity you want to include in your feed.

net: wwan: t7xx: Replace deprecated PCI functions

pcim_iomap_regions() and pcim_iomap_table() have been deprecated by the
PCI subsystem.

Replace them with pcim_iomap_region().

Additionally, pass the actual driver name to that function to improve
debug output.

Signed-off-by: Philipp Stanner <pstanner@redhat.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
Link: https://patch.msgid.link/20241206195712.182282-2-pstanner@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Philipp Stanner and committed by
Jakub Kicinski
ce864c76 90da34d1

+16 -7
+16 -7
drivers/net/wwan/t7xx/t7xx_pci.c
··· 43 43 #include "t7xx_state_monitor.h" 44 44 #include "t7xx_port_proxy.h" 45 45 46 + #define DRIVER_NAME "mtk_t7xx" 47 + 46 48 #define T7XX_PCI_IREG_BASE 0 47 49 #define T7XX_PCI_EREG_BASE 2 48 50 ··· 835 833 static int t7xx_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) 836 834 { 837 835 struct t7xx_pci_dev *t7xx_dev; 836 + void __iomem *iomem; 838 837 int ret; 839 838 840 839 t7xx_dev = devm_kzalloc(&pdev->dev, sizeof(*t7xx_dev), GFP_KERNEL); ··· 851 848 852 849 pci_set_master(pdev); 853 850 854 - ret = pcim_iomap_regions(pdev, BIT(T7XX_PCI_IREG_BASE) | BIT(T7XX_PCI_EREG_BASE), 855 - pci_name(pdev)); 851 + iomem = pcim_iomap_region(pdev, T7XX_PCI_IREG_BASE, DRIVER_NAME); 852 + ret = PTR_ERR_OR_ZERO(iomem); 856 853 if (ret) { 857 - dev_err(&pdev->dev, "Could not request BARs: %d\n", ret); 854 + dev_err(&pdev->dev, "Could not request IREG BAR: %d\n", ret); 858 855 return -ENOMEM; 859 856 } 857 + IREG_BASE(t7xx_dev) = iomem; 858 + 859 + iomem = pcim_iomap_region(pdev, T7XX_PCI_EREG_BASE, DRIVER_NAME); 860 + ret = PTR_ERR_OR_ZERO(iomem); 861 + if (ret) { 862 + dev_err(&pdev->dev, "Could not request EREG BAR: %d\n", ret); 863 + return -ENOMEM; 864 + } 865 + t7xx_dev->base_addr.pcie_ext_reg_base = iomem; 860 866 861 867 ret = dma_set_mask(&pdev->dev, DMA_BIT_MASK(64)); 862 868 if (ret) { ··· 878 866 dev_err(&pdev->dev, "Could not set consistent PCI DMA mask: %d\n", ret); 879 867 return ret; 880 868 } 881 - 882 - IREG_BASE(t7xx_dev) = pcim_iomap_table(pdev)[T7XX_PCI_IREG_BASE]; 883 - t7xx_dev->base_addr.pcie_ext_reg_base = pcim_iomap_table(pdev)[T7XX_PCI_EREG_BASE]; 884 869 885 870 ret = t7xx_pci_pm_init(t7xx_dev); 886 871 if (ret) ··· 946 937 MODULE_DEVICE_TABLE(pci, t7xx_pci_table); 947 938 948 939 static struct pci_driver t7xx_pci_driver = { 949 - .name = "mtk_t7xx", 940 + .name = DRIVER_NAME, 950 941 .id_table = t7xx_pci_table, 951 942 .probe = t7xx_pci_probe, 952 943 .remove = t7xx_pci_remove,