Skip to contentSkip to conversation

misc: cb710: Replace deprecated PCI functions

PATCH Superseded Madhur Kumar 4 participants 8 messages Sep 19, 2025 – Nov 11, 2025

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

PATCH 1/1 misc: cb710: Replace deprecated PCI functions

pcim_iomap_table() and pcim_iomap_regions() have been deprecated. Replace them with pcim_iomap_region().

---
 drivers/misc/cb710/core.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/misc/cb710/core.c +3 -4
index 55b7ee0e8f93..033e9e6d37db 100644
@@ -223,13 +223,12 @@ static int cb710_probe(struct pci_dev *pdev,
 	if (err)
 		return err;
 
-	err = pcim_iomap_regions(pdev, 0x0001, KBUILD_MODNAME);
-	if (err)
-		return err;
 
 	spin_lock_init(&chip->irq_lock);
 	chip->pdev = pdev;
-	chip->iobase = pcim_iomap_table(pdev)[0];
+	chip->iobase = pcim_iomap_region(pdev, 0, KBUILD_MODNAME);
+	if(!chip->iobase)
+		return -ENOMEM;
 
 	pci_set_drvdata(pdev, chip);
 
Signature · 1 line
2.51.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Madhur Kumar

pcim_iomap_table() and pcim_iomap_regions() have been deprecated. Replace them with pcim_iomap_region().

Quoted 28 lines
---
 drivers/misc/cb710/core.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/misc/cb710/core.c +3 -4
index 55b7ee0e8f93..033e9e6d37db 100644
@@ -223,13 +223,12 @@ static int cb710_probe(struct pci_dev *pdev,
 	if (err)
 		return err;
 
-	err = pcim_iomap_regions(pdev, 0x0001, KBUILD_MODNAME);
-	if (err)
-		return err;
 
 	spin_lock_init(&chip->irq_lock);
 	chip->pdev = pdev;
-	chip->iobase = pcim_iomap_table(pdev)[0];
+	chip->iobase = pcim_iomap_region(pdev, 0, KBUILD_MODNAME);
+	if(!chip->iobase)
+		return -ENOMEM;
 
 	pci_set_drvdata(pdev, chip);
 
Signature · 1 line
2.51.0
Signature · 1 line
Michał Mirosław
maintainer
#3 lore raw
Quoted 6 lines · Madhur Kumar
Quoted 1 line · Michał Mirosław

Thanks for the Ack!

Has this patch been applied or queued somewhere? Any feedback on the change?

It's the middle of the merge window, I can't do anything with it until after -rc1 is out.

thanks,

greg k-h

maintainer
#4 lore raw
In reply to Madhur Kumar
Quoted 32 lines · Madhur Kumar

pcim_iomap_table() and pcim_iomap_regions() have been deprecated. Replace them with pcim_iomap_region().

---
 drivers/misc/cb710/core.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/misc/cb710/core.c +3 -4
index 55b7ee0e8f93..033e9e6d37db 100644
@@ -223,13 +223,12 @@ static int cb710_probe(struct pci_dev *pdev,
 	if (err)
 		return err;
 
-	err = pcim_iomap_regions(pdev, 0x0001, KBUILD_MODNAME);
-	if (err)
-		return err;
 
 	spin_lock_init(&chip->irq_lock);
 	chip->pdev = pdev;
-	chip->iobase = pcim_iomap_table(pdev)[0];
+	chip->iobase = pcim_iomap_region(pdev, 0, KBUILD_MODNAME);
+	if(!chip->iobase)
+		return -ENOMEM;
 
 	pci_set_drvdata(pdev, chip);
 
Signature · 1 line
2.51.0

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him a patch that has triggered this response. He used to manually respond to these common problems, but in order to save his sanity (he kept writing the same thing over and over, yet to different people), I was created. Hopefully you will not take offence and will fix the problem in your patch and resubmit it so that it can be accepted into the Linux kernel tree.

You are receiving this message because of the following common error(s) as indicated below:

- Your patch contains warnings and/or errors noticed by the scripts/checkpatch.pl tool.

If you wish to discuss this problem further, or you have questions about how to resolve this issue, please feel free to respond to this email and Greg will reply once he has dug out from the pending patches received from other developers.

thanks,

greg k-h's patch email bot

#5 lore raw

PATCH v2 1/1 misc: cb710: Replace deprecated PCI functions

In reply to Madhur Kumar

pcim_iomap_table() and pcim_iomap_regions() have been deprecated. Replace them with pcim_iomap_region().

---
v2: fix checkpatch warning for missing space after 'if' in core.c

 drivers/misc/cb710/core.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/misc/cb710/core.c +3 -5
index 55b7ee0e8f93..a1e6ba62c298 100644
@@ -223,13 +223,11 @@ static int cb710_probe(struct pci_dev *pdev,
 	if (err)
 		return err;
 
-	err = pcim_iomap_regions(pdev, 0x0001, KBUILD_MODNAME);
-	if (err)
-		return err;
-
 	spin_lock_init(&chip->irq_lock);
 	chip->pdev = pdev;
-	chip->iobase = pcim_iomap_table(pdev)[0];
+	chip->iobase = pcim_iomap_region(pdev, 0, KBUILD_MODNAME);
+	if (!chip->iobase)
+		return -ENOMEM;
 
 	pci_set_drvdata(pdev, chip);
 
Signature · 1 line
2.51.0
#6 lore raw
Quoted 24 lines · Madhur Kumar

pcim_iomap_table() and pcim_iomap_regions() have been deprecated. Replace them with pcim_iomap_region().

---
v2: fix checkpatch warning for missing space after 'if' in core.c

 drivers/misc/cb710/core.c | 8 +++-----

 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/misc/cb710/core.c +0 -0
index 55b7ee0e8f93..a1e6ba62c298 100644
@@ -223,13 +223,11 @@ static int cb710_probe(struct pci_dev *pdev,
  	if (err)
  		return err;

drivers/misc/cb710/core.c +0 -4
-	err = pcim_iomap_regions(pdev, 0x0001, KBUILD_MODNAME);
-	if (err)
-		return err;
-

  spin_lock_init(&chip->irq_lock);
  chip->pdev = pdev;

drivers/misc/cb710/core.c static int cb710_probe(struct pci_dev *pdev, · line 229

Quoted 3 lines
drivers/misc/cb710/core.c +2 -1
-	chip->iobase = pcim_iomap_table(pdev)[0];
+	chip->iobase = pcim_iomap_region(pdev, 0, KBUILD_MODNAME);
+	if (!chip->iobase)

Nope, this is wrong. pcim_iomap_region() returns an ERR_PTR on error, not NULL. You need to check it with IS_ERR or similar.

Sry, late to the party, but just saw this. It was applied already, so someone should send a fix. I could, but maybe Madhur can do it faster since he's got the branch etc already.

Thx,
P.

Quoted 4 lines
drivers/misc/cb710/core.c +1 -0
+		return -ENOMEM;


  pci_set_drvdata(pdev, chip);

#7 lore raw
Quoted 6 lines · Philipp Stanner

Nope, this is wrong. pcim_iomap_region() returns an ERR_PTR on error, not NULL. You need to check it with IS_ERR or similar.

Sry, late to the party, but just saw this. It was applied already, so someone should send a fix. I could, but maybe Madhur can do it faster since he's got the branch etc already.

Thank you for pointing it out but the issue if already been fixed by Dan Carpenter
https://lore.kernel.org/all/[email protected]/

--
Madhur Kumar