diff options
author | Linus Walleij <linus.walleij@stericsson.com> | 2009-06-14 02:20:36 +0400 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2009-06-17 01:42:16 +0400 |
commit | c6ffddea36dd576b70dfbd10eb5d2b287b786dca (patch) | |
tree | 9849cac5ca77534e38b4cb3c35a09d980ae84ff3 /drivers/i2c/busses/i2c-pmcmsp.c | |
parent | 18904c0ecdf2cf22347da2adc4b273e9570333d8 (diff) | |
download | linux-c6ffddea36dd576b70dfbd10eb5d2b287b786dca.tar.xz |
i2c: Use resource_size macro
This replace all instances in the i2c busses tree of
res->end - res->start + 1 with the handy macro resource_size(res)
from ioport.h (coming in from platform_device.h).
This was created with a simple
sed -i -e 's/\([a-z]*\)->end *- *[a-z]*->start *+ *1/resource_size(\1)/g'
Then manually replacing the PXA redefiniton of the same kind
of macro manually. Recompiled some ARM defconfigs I could find to
make a rough test so it shouldn't break anything, though I
couldn't see exactly which configs you need for all the drivers.
Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'drivers/i2c/busses/i2c-pmcmsp.c')
-rw-r--r-- | drivers/i2c/busses/i2c-pmcmsp.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/i2c/busses/i2c-pmcmsp.c b/drivers/i2c/busses/i2c-pmcmsp.c index 0bdb2d7f0570..7b57d5f267e1 100644 --- a/drivers/i2c/busses/i2c-pmcmsp.c +++ b/drivers/i2c/busses/i2c-pmcmsp.c @@ -283,7 +283,7 @@ static int __devinit pmcmsptwi_probe(struct platform_device *pldev) } /* reserve the memory region */ - if (!request_mem_region(res->start, res->end - res->start + 1, + if (!request_mem_region(res->start, resource_size(res), pldev->name)) { dev_err(&pldev->dev, "Unable to get memory/io address region 0x%08x\n", @@ -294,7 +294,7 @@ static int __devinit pmcmsptwi_probe(struct platform_device *pldev) /* remap the memory */ pmcmsptwi_data.iobase = ioremap_nocache(res->start, - res->end - res->start + 1); + resource_size(res)); if (!pmcmsptwi_data.iobase) { dev_err(&pldev->dev, "Unable to ioremap address 0x%08x\n", res->start); @@ -360,7 +360,7 @@ ret_unmap: iounmap(pmcmsptwi_data.iobase); ret_unreserve: - release_mem_region(res->start, res->end - res->start + 1); + release_mem_region(res->start, resource_size(res)); ret_err: return rc; @@ -385,7 +385,7 @@ static int __devexit pmcmsptwi_remove(struct platform_device *pldev) iounmap(pmcmsptwi_data.iobase); res = platform_get_resource(pldev, IORESOURCE_MEM, 0); - release_mem_region(res->start, res->end - res->start + 1); + release_mem_region(res->start, resource_size(res)); return 0; } |