spi: Convert uses of struct resource * to resource_size(ptr)

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: Grant Likely <grant.likely@secretlab.ca>
This commit is contained in:
Joe Perches
2011-06-10 18:11:25 -07:00
committed by Grant Likely
parent e4c8308c85
commit 8e2943c04c
5 changed files with 14 additions and 14 deletions

View File

@@ -489,7 +489,7 @@ static int __init orion_spi_probe(struct platform_device *pdev)
goto out;
}
if (!request_mem_region(r->start, (r->end - r->start) + 1,
if (!request_mem_region(r->start, resource_size(r),
dev_name(&pdev->dev))) {
status = -EBUSY;
goto out;
@@ -511,7 +511,7 @@ static int __init orion_spi_probe(struct platform_device *pdev)
return status;
out_rel_mem:
release_mem_region(r->start, (r->end - r->start) + 1);
release_mem_region(r->start, resource_size(r));
out:
spi_master_put(master);
@@ -531,7 +531,7 @@ static int __exit orion_spi_remove(struct platform_device *pdev)
cancel_work_sync(&spi->work);
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
release_mem_region(r->start, (r->end - r->start) + 1);
release_mem_region(r->start, resource_size(r));
spi_unregister_master(master);