diff options
author | H Hartley Sweeten <hartleys@visionengravers.com> | 2009-12-14 16:30:46 -0500 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2009-12-31 15:47:01 -0500 |
commit | db5a5ae25aae66354712674b1643759897ff0325 (patch) | |
tree | 03fa0524f62511f717f85e768019874648653212 /drivers/mtd/nand/gpio.c | |
parent | 58e6a84dfbd6f125b69e8b105c2cdbf22f97d5de (diff) |
mtd: drivers/mtd/nand/gpio.c: use resource_size()
Use resource_size().
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/nand/gpio.c')
-rw-r--r-- | 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 8f902e75aa85..0cde618bcc1e 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) | |||
181 | res = platform_get_resource(dev, IORESOURCE_MEM, 1); | 181 | res = platform_get_resource(dev, IORESOURCE_MEM, 1); |
182 | iounmap(gpiomtd->io_sync); | 182 | iounmap(gpiomtd->io_sync); |
183 | if (res) | 183 | if (res) |
184 | release_mem_region(res->start, res->end - res->start + 1); | 184 | release_mem_region(res->start, resource_size(res)); |
185 | 185 | ||
186 | res = platform_get_resource(dev, IORESOURCE_MEM, 0); | 186 | res = platform_get_resource(dev, IORESOURCE_MEM, 0); |
187 | iounmap(gpiomtd->nand_chip.IO_ADDR_R); | 187 | iounmap(gpiomtd->nand_chip.IO_ADDR_R); |
188 | release_mem_region(res->start, res->end - res->start + 1); | 188 | release_mem_region(res->start, resource_size(res)); |
189 | 189 | ||
190 | if (gpio_is_valid(gpiomtd->plat.gpio_nwp)) | 190 | if (gpio_is_valid(gpiomtd->plat.gpio_nwp)) |
191 | gpio_set_value(gpiomtd->plat.gpio_nwp, 0); | 191 | gpio_set_value(gpiomtd->plat.gpio_nwp, 0); |
@@ -208,14 +208,14 @@ static void __iomem *request_and_remap(struct resource *res, size_t size, | |||
208 | { | 208 | { |
209 | void __iomem *ptr; | 209 | void __iomem *ptr; |
210 | 210 | ||
211 | if (!request_mem_region(res->start, res->end - res->start + 1, name)) { | 211 | if (!request_mem_region(res->start, resource_size(res), name)) { |
212 | *err = -EBUSY; | 212 | *err = -EBUSY; |
213 | return NULL; | 213 | return NULL; |
214 | } | 214 | } |
215 | 215 | ||
216 | ptr = ioremap(res->start, size); | 216 | ptr = ioremap(res->start, size); |
217 | if (!ptr) { | 217 | if (!ptr) { |
218 | release_mem_region(res->start, res->end - res->start + 1); | 218 | release_mem_region(res->start, resource_size(res)); |
219 | *err = -ENOMEM; | 219 | *err = -ENOMEM; |
220 | } | 220 | } |
221 | return ptr; | 221 | return ptr; |
@@ -338,10 +338,10 @@ err_nwp: | |||
338 | err_nce: | 338 | err_nce: |
339 | iounmap(gpiomtd->io_sync); | 339 | iounmap(gpiomtd->io_sync); |
340 | if (res1) | 340 | if (res1) |
341 | release_mem_region(res1->start, res1->end - res1->start + 1); | 341 | release_mem_region(res1->start, resource_size(res1)); |
342 | err_sync: | 342 | err_sync: |
343 | iounmap(gpiomtd->nand_chip.IO_ADDR_R); | 343 | iounmap(gpiomtd->nand_chip.IO_ADDR_R); |
344 | release_mem_region(res0->start, res0->end - res0->start + 1); | 344 | release_mem_region(res0->start, resource_size(res0)); |
345 | err_map: | 345 | err_map: |
346 | kfree(gpiomtd); | 346 | kfree(gpiomtd); |
347 | return ret; | 347 | return ret; |