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

thunderbolt: Replace deprecated PCI functions

pcim_iomap_table() and pcim_request_regions() have been deprecated in
commit e354bb84a4c1 ("PCI: Deprecate pcim_iomap_table(),
pcim_iomap_regions_request_all()") and commit d140f80f60358 ("PCI:
Deprecate pcim_iomap_regions() in favor of pcim_iomap_region()").

Replace these functions with pcim_iomap_region().

Signed-off-by: Philipp Stanner <pstanner@redhat.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>

authored by

Philipp Stanner and committed by
Mika Westerberg
40aeea50 916f26f1

+6 -6
+6 -6
drivers/thunderbolt/nhi.c
··· 1340 1340 if (res) 1341 1341 return dev_err_probe(dev, res, "cannot enable PCI device, aborting\n"); 1342 1342 1343 - res = pcim_iomap_regions(pdev, 1 << 0, "thunderbolt"); 1344 - if (res) 1345 - return dev_err_probe(dev, res, "cannot obtain PCI resources, aborting\n"); 1346 - 1347 1343 nhi = devm_kzalloc(&pdev->dev, sizeof(*nhi), GFP_KERNEL); 1348 1344 if (!nhi) 1349 1345 return -ENOMEM; 1350 1346 1351 1347 nhi->pdev = pdev; 1352 1348 nhi->ops = (const struct tb_nhi_ops *)id->driver_data; 1353 - /* cannot fail - table is allocated in pcim_iomap_regions */ 1354 - nhi->iobase = pcim_iomap_table(pdev)[0]; 1349 + 1350 + nhi->iobase = pcim_iomap_region(pdev, 0, "thunderbolt"); 1351 + res = PTR_ERR_OR_ZERO(nhi->iobase); 1352 + if (res) 1353 + return dev_err_probe(dev, res, "cannot obtain PCI resources, aborting\n"); 1354 + 1355 1355 nhi->hop_count = ioread32(nhi->iobase + REG_CAPS) & 0x3ff; 1356 1356 dev_dbg(dev, "total paths: %d\n", nhi->hop_count); 1357 1357