Skip to contentSkip to conversation

dma: at_hdmac.c: use resource_size

PATCH Applied H Hartley Sweeten 2 participants 2 messages Jun 1, 2011 – Jun 6, 2011

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

PATCH 1/1 dma: at_hdmac.c: use resource_size

---

drivers/dma/at_hdmac.c +2 -2
index 36144f8..6a483ea 100644
@@ -1216,7 +1216,7 @@ static int __init at_dma_probe(struct platform_device *pdev)
 	atdma->dma_common.cap_mask = pdata->cap_mask;
 	atdma->all_chan_mask = (1 << pdata->nr_channels) - 1;
 
-	size = io->end - io->start + 1;
+	size = resource_size(io);
 	if (!request_mem_region(io->start, size, pdev->dev.driver->name)) {
 		err = -EBUSY;
 		goto err_kfree;
@@ -1362,7 +1362,7 @@ static int __exit at_dma_remove(struct platform_device *pdev)
 	atdma->regs = NULL;
 
 	io = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	release_mem_region(io->start, io->end - io->start + 1);
+	release_mem_region(io->start, resource_size(io));
 
 	kfree(atdma);
 
Applied
#1 lore raw
Quoted 20 lines · H Hartley Sweeten

---

drivers/dma/at_hdmac.c +1 -1
index 36144f8..6a483ea 100644
@@ -1216,7 +1216,7 @@ static int __init at_dma_probe(struct platform_device *pdev)
 	atdma->dma_common.cap_mask = pdata->cap_mask;
 	atdma->all_chan_mask = (1 << pdata->nr_channels) - 1;
 
-	size = io->end - io->start + 1;
+	size = resource_size(io);
 	if (!request_mem_region(io->start, size, pdev->dev.driver->name)) {
 		err = -EBUSY;
 		goto err_kfree;

drivers/dma/at_hdmac.c static int __exit at_dma_remove(struct platform_device *pdev) · line 1368

Quoted 8 lines
drivers/dma/at_hdmac.c +1 -1
@@ -1362,7 +1362,7 @@ static int __exit at_dma_remove(struct platform_device *pdev)
 	atdma->regs = NULL;
 
 	io = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	release_mem_region(io->start, io->end - io->start + 1);
+	release_mem_region(io->start, resource_size(io));
 
 	kfree(atdma);
 

Applied, Thanks

Signature · 1 line
~Vinod