Skip to contentSkip to conversation

ptp_pch: Replace deprecated PCI functions

PATCH Applied Philipp Stanner 3 participants 3 messages Oct 28, 2024 – Nov 1, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ptp_pch: Replace deprecated PCI functions

pcim_iomap_regions() and pcim_iomap_table() have been deprecated in commit e354bb84a4c1 ("PCI: Deprecate pcim_iomap_table(), pcim_iomap_regions_request_all()").

Replace these functions with pcim_iomap_region().

Additionally, pass KBUILD_MODNAME to that function, since the 'name' parameter should indicate who (i.e., which driver) has requested the resource.

---
 drivers/ptp/ptp_pch.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/ptp/ptp_pch.c +3 -3
index 33355d5eb033..b8a9a54a176c 100644
@@ -462,14 +462,14 @@ pch_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 		return ret;
 	}
 
-	ret = pcim_iomap_regions(pdev, BIT(IO_MEM_BAR), "1588_regs");
+	/* get the virtual address to the 1588 registers */
+	chip->regs = pcim_iomap_region(pdev, IO_MEM_BAR, KBUILD_MODNAME);
+	ret = PTR_ERR_OR_ZERO(chip->regs);
 	if (ret) {
 		dev_err(&pdev->dev, "could not locate IO memory address\n");
 		return ret;
 	}
 
-	/* get the virtual address to the 1588 registers */
-	chip->regs = pcim_iomap_table(pdev)[IO_MEM_BAR];
 	chip->caps = ptp_pch_caps;
 	chip->ptp_clock = ptp_clock_register(&chip->caps, &pdev->dev);
 	if (IS_ERR(chip->ptp_clock))
Signature · 1 line
2.47.0
maintainer
#1 lore raw
Quoted 3 lines · On Mon, 28 Oct 2024 10:59:44 +0100 Philipp Stanner wrote:

Additionally, pass KBUILD_MODNAME to that function, since the 'name' parameter should indicate who (i.e., which driver) has requested the resource.

Not sure if anyone cares but in theory this could break something. Let's find out..

#2 lore raw
In reply to Philipp Stanner
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 11 lines · On Mon, 28 Oct 2024 10:59:44 +0100 you wrote:

pcim_iomap_regions() and pcim_iomap_table() have been deprecated in commit e354bb84a4c1 ("PCI: Deprecate pcim_iomap_table(), pcim_iomap_regions_request_all()").

Replace these functions with pcim_iomap_region().

Additionally, pass KBUILD_MODNAME to that function, since the 'name' parameter should indicate who (i.e., which driver) has requested the resource.

[...]

Here is the summary with links:
- ptp_pch: Replace deprecated PCI functions

    https://git.kernel.org/netdev/net-next/c/9c5649c17737

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html