mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] x86/platform/intel-mid: Replace deprecated PCI functions
@ 2024-11-11 10:36 Philipp Stanner
  2024-11-11 11:18 ` [tip: x86/platform] " tip-bot2 for Philipp Stanner
  0 siblings, 1 reply; 2+ messages in thread
From: Philipp Stanner @ 2024-11-11 10:36 UTC (permalink / raw)
  To: Andy Shevchenko, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	Dave Hansen, H . Peter Anvin
  Cc: x86, linux-kernel, Philipp Stanner, Andy Shevchenko

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()"),
respectively.

Replace these functions with pcim_iomap_region().

Additionally, pass the actual driver name to pcim_iomap_region()
instead of the previous pci_name(), since the 'name' parameter should
always reflect which driver owns a region.

Signed-off-by: Philipp Stanner <pstanner@redhat.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
Changes in v2:
  - (Re-)add dev_err() print message. (Andy)
  - Add Andy's RB.
---
 arch/x86/platform/intel-mid/pwr.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/x86/platform/intel-mid/pwr.c b/arch/x86/platform/intel-mid/pwr.c
index 27288d8d3f71..cd7e0c71adde 100644
--- a/arch/x86/platform/intel-mid/pwr.c
+++ b/arch/x86/platform/intel-mid/pwr.c
@@ -358,18 +358,18 @@ static int mid_pwr_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 		return ret;
 	}
 
-	ret = pcim_iomap_regions(pdev, 1 << 0, pci_name(pdev));
-	if (ret) {
-		dev_err(&pdev->dev, "I/O memory remapping failed\n");
-		return ret;
-	}
-
 	pwr = devm_kzalloc(dev, sizeof(*pwr), GFP_KERNEL);
 	if (!pwr)
 		return -ENOMEM;
 
+	pwr->regs = pcim_iomap_region(pdev, 0, "intel_mid_pwr");
+	ret = PTR_ERR_OR_ZERO(pwr->regs);
+	if (ret) {
+		dev_err(&pdev->dev, "Could not request / ioremap I/O-Mem: %d\n", ret);
+		return ret;
+	}
+
 	pwr->dev = dev;
-	pwr->regs = pcim_iomap_table(pdev)[0];
 	pwr->irq = pdev->irq;
 
 	mutex_init(&pwr->lock);
-- 
2.47.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [tip: x86/platform] x86/platform/intel-mid: Replace deprecated PCI functions
  2024-11-11 10:36 [PATCH v2] x86/platform/intel-mid: Replace deprecated PCI functions Philipp Stanner
@ 2024-11-11 11:18 ` tip-bot2 for Philipp Stanner
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot2 for Philipp Stanner @ 2024-11-11 11:18 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Philipp Stanner, Borislav Petkov (AMD),
	Andy Shevchenko, x86, linux-kernel

The following commit has been merged into the x86/platform branch of tip:

Commit-ID:     90f1b42b179487ee77d182893408cc1c40d50b13
Gitweb:        https://git.kernel.org/tip/90f1b42b179487ee77d182893408cc1c40d50b13
Author:        Philipp Stanner <pstanner@redhat.com>
AuthorDate:    Mon, 11 Nov 2024 11:36:03 +01:00
Committer:     Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Mon, 11 Nov 2024 11:59:21 +01:00

x86/platform/intel-mid: Replace deprecated PCI functions

pcim_iomap_table() and pcim_request_regions() have been deprecated in

  e354bb84a4c1 ("PCI: Deprecate pcim_iomap_table(), pcim_iomap_regions_request_all()") and
  d140f80f6035 ("PCI: Deprecate pcim_iomap_regions() in favor of pcim_iomap_region()"),

respectively.

Replace these functions with pcim_iomap_region().

Additionally, pass the actual driver name to pcim_iomap_region() instead of
the previous pci_name(), since the @name parameter should always reflect which
driver owns a region.

Signed-off-by: Philipp Stanner <pstanner@redhat.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20241111103602.16615-2-pstanner@redhat.com
---
 arch/x86/platform/intel-mid/pwr.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/x86/platform/intel-mid/pwr.c b/arch/x86/platform/intel-mid/pwr.c
index 27288d8..cd7e0c7 100644
--- a/arch/x86/platform/intel-mid/pwr.c
+++ b/arch/x86/platform/intel-mid/pwr.c
@@ -358,18 +358,18 @@ static int mid_pwr_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 		return ret;
 	}
 
-	ret = pcim_iomap_regions(pdev, 1 << 0, pci_name(pdev));
-	if (ret) {
-		dev_err(&pdev->dev, "I/O memory remapping failed\n");
-		return ret;
-	}
-
 	pwr = devm_kzalloc(dev, sizeof(*pwr), GFP_KERNEL);
 	if (!pwr)
 		return -ENOMEM;
 
+	pwr->regs = pcim_iomap_region(pdev, 0, "intel_mid_pwr");
+	ret = PTR_ERR_OR_ZERO(pwr->regs);
+	if (ret) {
+		dev_err(&pdev->dev, "Could not request / ioremap I/O-Mem: %d\n", ret);
+		return ret;
+	}
+
 	pwr->dev = dev;
-	pwr->regs = pcim_iomap_table(pdev)[0];
 	pwr->irq = pdev->irq;
 
 	mutex_init(&pwr->lock);

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-11-11 11:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-11 10:36 [PATCH v2] x86/platform/intel-mid: Replace deprecated PCI functions Philipp Stanner
2024-11-11 11:18 ` [tip: x86/platform] " tip-bot2 for Philipp Stanner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®