Skip to contentSkip to conversation

dw_dmac: don't check resource with devm_ioremap_resource

PATCH In review Andy Shevchenko 2 participants 2 messages May 20, 2013 dmaengine

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 dw_dmac: don't check resource with devm_ioremap_resource

devm_ioremap_resource does sanity checks on the given resource. No need to duplicate this in the driver.

---
Since v1:
- fix commit message to be along with other similar patches

 drivers/dma/dw_dmac.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/dma/dw_dmac.c +1 -4
index 89b655e..6dc6866 100644
@@ -1670,14 +1670,11 @@ static int dw_probe(struct platform_device *pdev)
 	int			err;
 	int			i;
 
-	io = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!io)
-		return -EINVAL;
-
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0)
 		return irq;
 
+	io = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	regs = devm_ioremap_resource(&pdev->dev, io);
 	if (IS_ERR(regs))
 		return PTR_ERR(regs);
Signature · 1 line
1.8.2.rc0.22.gb3600c3
Acked-by on v2 1/1
#1 lore raw
Quoted 7 lines · Andy Shevchenko

devm_ioremap_resource does sanity checks on the given resource. No need to duplicate this in the driver.

---
Since v1:
- fix commit message to be along with other similar patches

Please always add a blank line here.

Quoted 2 lines
 drivers/dma/dw_dmac.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)