treewide: Convert uses of struct resource to resource_size(ptr)
Several fixes as well where the +1 was missing. Done via coccinelle scripts like: @@ struct resource *ptr; @@ - ptr->end - ptr->start + 1 + resource_size(ptr) and some grep and typing. Mostly uncompiled, no cross-compilers. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
@@ -1821,7 +1821,7 @@ static int __devinit davinci_emac_probe(struct platform_device *pdev)
|
||||
}
|
||||
|
||||
priv->emac_base_phys = res->start + pdata->ctrl_reg_offset;
|
||||
size = res->end - res->start + 1;
|
||||
size = resource_size(res);
|
||||
if (!request_mem_region(res->start, size, ndev->name)) {
|
||||
dev_err(&pdev->dev, "failed request_mem_region() for regs\n");
|
||||
rc = -ENXIO;
|
||||
@@ -1926,7 +1926,7 @@ no_irq_res:
|
||||
cpdma_ctlr_destroy(priv->dma);
|
||||
no_dma:
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
release_mem_region(res->start, res->end - res->start + 1);
|
||||
release_mem_region(res->start, resource_size(res));
|
||||
iounmap(priv->remap_addr);
|
||||
|
||||
probe_quit:
|
||||
@@ -1960,7 +1960,7 @@ static int __devexit davinci_emac_remove(struct platform_device *pdev)
|
||||
cpdma_chan_destroy(priv->rxchan);
|
||||
cpdma_ctlr_destroy(priv->dma);
|
||||
|
||||
release_mem_region(res->start, res->end - res->start + 1);
|
||||
release_mem_region(res->start, resource_size(res));
|
||||
|
||||
unregister_netdev(ndev);
|
||||
iounmap(priv->remap_addr);
|
||||
|
Reference in New Issue
Block a user