mtd: drivers/mtd/nand/gpio.c: use resource_size()
Linux-MTD Mailing List
linux-mtd at lists.infradead.org
Thu Dec 31 15:59:02 EST 2009
Gitweb: http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=db5a5ae25aae66354712674b1643759897ff0325
Commit: db5a5ae25aae66354712674b1643759897ff0325
Parent: 58e6a84dfbd6f125b69e8b105c2cdbf22f97d5de
Author: H Hartley Sweeten <hartleys at visionengravers.com>
AuthorDate: Mon Dec 14 16:30:46 2009 -0500
Committer: David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Thu Dec 31 20:47:01 2009 +0000
mtd: drivers/mtd/nand/gpio.c: use resource_size()
Use resource_size().
Signed-off-by: H Hartley Sweeten <hsweeten at visionengravers.com>
Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
drivers/mtd/nand/gpio.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/mtd/nand/gpio.c b/drivers/mtd/nand/gpio.c
index 8f902e7..0cde618 100644
--- a/drivers/mtd/nand/gpio.c
+++ b/drivers/mtd/nand/gpio.c
@@ -181,11 +181,11 @@ static int __devexit gpio_nand_remove(struct platform_device *dev)
res = platform_get_resource(dev, IORESOURCE_MEM, 1);
iounmap(gpiomtd->io_sync);
if (res)
- release_mem_region(res->start, res->end - res->start + 1);
+ release_mem_region(res->start, resource_size(res));
res = platform_get_resource(dev, IORESOURCE_MEM, 0);
iounmap(gpiomtd->nand_chip.IO_ADDR_R);
- release_mem_region(res->start, res->end - res->start + 1);
+ release_mem_region(res->start, resource_size(res));
if (gpio_is_valid(gpiomtd->plat.gpio_nwp))
gpio_set_value(gpiomtd->plat.gpio_nwp, 0);
@@ -208,14 +208,14 @@ static void __iomem *request_and_remap(struct resource *res, size_t size,
{
void __iomem *ptr;
- if (!request_mem_region(res->start, res->end - res->start + 1, name)) {
+ if (!request_mem_region(res->start, resource_size(res), name)) {
*err = -EBUSY;
return NULL;
}
ptr = ioremap(res->start, size);
if (!ptr) {
- release_mem_region(res->start, res->end - res->start + 1);
+ release_mem_region(res->start, resource_size(res));
*err = -ENOMEM;
}
return ptr;
@@ -338,10 +338,10 @@ err_nwp:
err_nce:
iounmap(gpiomtd->io_sync);
if (res1)
- release_mem_region(res1->start, res1->end - res1->start + 1);
+ release_mem_region(res1->start, resource_size(res1));
err_sync:
iounmap(gpiomtd->nand_chip.IO_ADDR_R);
- release_mem_region(res0->start, res0->end - res0->start + 1);
+ release_mem_region(res0->start, resource_size(res0));
err_map:
kfree(gpiomtd);
return ret;
More information about the linux-mtd-cvs
mailing list