aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-omap2-mcspi.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2011-06-10 21:11:25 -0400
committerGrant Likely <grant.likely@secretlab.ca>2011-06-11 01:43:41 -0400
commit8e2943c04c74e537c762c09bcea89e923510a9ac (patch)
tree6ea287e3597434d14c976d63c1dbf7c7d330e41a /drivers/spi/spi-omap2-mcspi.c
parente4c8308c852e6b3fa49215052a5b9e99597dee99 (diff)
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>
Diffstat (limited to 'drivers/spi/spi-omap2-mcspi.c')
-rw-r--r--drivers/spi/spi-omap2-mcspi.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
index 969cdd2fe124..fde3a2d4f120 100644
--- a/drivers/spi/spi-omap2-mcspi.c
+++ b/drivers/spi/spi-omap2-mcspi.c
@@ -1116,8 +1116,8 @@ static int __init omap2_mcspi_probe(struct platform_device *pdev)
1116 status = -ENODEV; 1116 status = -ENODEV;
1117 goto err1; 1117 goto err1;
1118 } 1118 }
1119 if (!request_mem_region(r->start, (r->end - r->start) + 1, 1119 if (!request_mem_region(r->start, resource_size(r),
1120 dev_name(&pdev->dev))) { 1120 dev_name(&pdev->dev))) {
1121 status = -EBUSY; 1121 status = -EBUSY;
1122 goto err1; 1122 goto err1;
1123 } 1123 }
@@ -1125,7 +1125,7 @@ static int __init omap2_mcspi_probe(struct platform_device *pdev)
1125 r->start += pdata->regs_offset; 1125 r->start += pdata->regs_offset;
1126 r->end += pdata->regs_offset; 1126 r->end += pdata->regs_offset;
1127 mcspi->phys = r->start; 1127 mcspi->phys = r->start;
1128 mcspi->base = ioremap(r->start, r->end - r->start + 1); 1128 mcspi->base = ioremap(r->start, resource_size(r));
1129 if (!mcspi->base) { 1129 if (!mcspi->base) {
1130 dev_dbg(&pdev->dev, "can't ioremap MCSPI\n"); 1130 dev_dbg(&pdev->dev, "can't ioremap MCSPI\n");
1131 status = -ENOMEM; 1131 status = -ENOMEM;
@@ -1190,7 +1190,7 @@ err4:
1190err3: 1190err3:
1191 kfree(mcspi->dma_channels); 1191 kfree(mcspi->dma_channels);
1192err2: 1192err2:
1193 release_mem_region(r->start, (r->end - r->start) + 1); 1193 release_mem_region(r->start, resource_size(r));
1194 iounmap(mcspi->base); 1194 iounmap(mcspi->base);
1195err1: 1195err1:
1196 return status; 1196 return status;
@@ -1210,7 +1210,7 @@ static int __exit omap2_mcspi_remove(struct platform_device *pdev)
1210 1210
1211 omap2_mcspi_disable_clocks(mcspi); 1211 omap2_mcspi_disable_clocks(mcspi);
1212 r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1212 r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1213 release_mem_region(r->start, (r->end - r->start) + 1); 1213 release_mem_region(r->start, resource_size(r));
1214 1214
1215 base = mcspi->base; 1215 base = mcspi->base;
1216 spi_unregister_master(master); 1216 spi_unregister_master(master);