Skip to contentSkip to conversation

staging: dwc2: use devm_ioremap_resource()

PATCH In review Laurent Navet 3 participants 3 messages May 2, 2013 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: dwc2: use devm_ioremap_resource()

Replace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource.

Found with coccicheck and this semantic patch:
scripts/coccinelle/api/devm_request_and_ioremap.cocci.

---
 drivers/staging/dwc2/pci.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/dwc2/pci.c +3 -3
index 69c65eb..407e021 100644
@@ -134,9 +134,9 @@ static int dwc2_driver_probe(struct pci_dev *dev,
 	pci_set_power_state(dev, PCI_D0);
 
 	hsotg->dev = &dev->dev;
-	hsotg->regs = devm_request_and_ioremap(&dev->dev, &dev->resource[0]);
-	if (!hsotg->regs)
-		return -ENOMEM;
+	hsotg->regs = devm_ioremap_resource(&dev->dev, &dev->resource[0]);
+	if (IS_ERR(hsotg->regs))
+		return PTR_ERR(hsotg->regs);
 
 	dev_dbg(&dev->dev, "mapped PA %08lx to VA %p\n",
 		(unsigned long)pci_resource_start(dev, 0), hsotg->regs);
Signature · 1 line
1.7.10.4
Reviewed-by on v1 1/1
#1 lore raw

Hi Laurent,

Quoted 10 lines · Laurent Navet

Replace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource.

Found with coccicheck and this semantic patch:
scripts/coccinelle/api/devm_request_and_ioremap.cocci.

---
 drivers/staging/dwc2/pci.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Patch looks good, I had a bit-for-bit identical patch in my queue here as well :-)

Gr.

Matthijs

Quoted 24 lines
drivers/staging/dwc2/pci.c +3 -3
index 69c65eb..407e021 100644
@@ -134,9 +134,9 @@ static int dwc2_driver_probe(struct pci_dev *dev,
 	pci_set_power_state(dev, PCI_D0);
 
 	hsotg->dev = &dev->dev;
-	hsotg->regs = devm_request_and_ioremap(&dev->dev, &dev->resource[0]);
-	if (!hsotg->regs)
-		return -ENOMEM;
+	hsotg->regs = devm_ioremap_resource(&dev->dev, &dev->resource[0]);
+	if (IS_ERR(hsotg->regs))
+		return PTR_ERR(hsotg->regs);
 
 	dev_dbg(&dev->dev, "mapped PA %08lx to VA %p\n",
 		(unsigned long)pci_resource_start(dev, 0), hsotg->regs);
Signature · 6 lines
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw
Quoted 14 lines

From: Matthijs Kooijman [mailto:[email protected]]
Sent: Thursday, May 02, 2013 4:22 AM

Quoted 10 lines · Laurent Navet

Replace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource.

Found with coccicheck and this semantic patch:
scripts/coccinelle/api/devm_request_and_ioremap.cocci.

---
 drivers/staging/dwc2/pci.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Quoted 4 lines

Patch looks good, I had a bit-for-bit identical patch in my queue here as well :-)