Skip to contentSkip to conversation

staging: emxx_udc: use devm_platform_ioremap_resource() to simplify code

PATCH New YueHaibing 1 participant 1 message Oct 9, 2019 Staging

lore
Share & tools
lore

YueHaibing

author
#0 lore raw

PATCH 1/1 staging: emxx_udc: use devm_platform_ioremap_resource() to simplify code

Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle.

---
 drivers/staging/emxx_udc/emxx_udc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/emxx_udc/emxx_udc.c +1 -3
index 147481b..9e0c19e 100644
@@ -3078,7 +3078,6 @@ static int nbu2ss_drv_probe(struct platform_device *pdev)
 {
 	int	status = -ENODEV;
 	struct nbu2ss_udc	*udc;
-	struct resource *r;
 	int irq;
 	void __iomem *mmio_base;
 
@@ -3088,8 +3087,7 @@ static int nbu2ss_drv_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, udc);
 
 	/* require I/O memory and IRQ to be provided as resources */
-	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	mmio_base = devm_ioremap_resource(&pdev->dev, r);
+	mmio_base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(mmio_base))
 		return PTR_ERR(mmio_base);
 
Signature · 1 line
2.7.4