aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/at91_cf.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2011-06-09 12:13:32 -0400
committerJiri Kosina <jkosina@suse.cz>2011-06-10 08:55:36 -0400
commit28f65c11f2ffb3957259dece647a24f8ad2e241b (patch)
tree6b7621d09d10df89eedd908d4506fb9f457a909f /drivers/pcmcia/at91_cf.c
parent140a1ef2f91a00e1d25f0878c193abdc25bf6ebe (diff)
treewide: Convert uses of struct resource to resource_size(ptr)
Several fixes as well where the +1 was missing. 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: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/pcmcia/at91_cf.c')
-rw-r--r--drivers/pcmcia/at91_cf.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/pcmcia/at91_cf.c b/drivers/pcmcia/at91_cf.c
index fb33fa42d24..4902206f53d 100644
--- a/drivers/pcmcia/at91_cf.c
+++ b/drivers/pcmcia/at91_cf.c
@@ -283,8 +283,7 @@ static int __init at91_cf_probe(struct platform_device *pdev)
283 } 283 }
284 284
285 /* reserve chip-select regions */ 285 /* reserve chip-select regions */
286 if (!request_mem_region(io->start, io->end + 1 - io->start, 286 if (!request_mem_region(io->start, resource_size(io), driver_name)) {
287 driver_name)) {
288 status = -ENXIO; 287 status = -ENXIO;
289 goto fail1; 288 goto fail1;
290 } 289 }
@@ -308,7 +307,7 @@ static int __init at91_cf_probe(struct platform_device *pdev)
308 return 0; 307 return 0;
309 308
310fail2: 309fail2:
311 release_mem_region(io->start, io->end + 1 - io->start); 310 release_mem_region(io->start, resource_size(io));
312fail1: 311fail1:
313 if (cf->socket.io_offset) 312 if (cf->socket.io_offset)
314 iounmap((void __iomem *) cf->socket.io_offset); 313 iounmap((void __iomem *) cf->socket.io_offset);
@@ -339,7 +338,7 @@ static int __exit at91_cf_remove(struct platform_device *pdev)
339 struct resource *io = cf->socket.io[0].res; 338 struct resource *io = cf->socket.io[0].res;
340 339
341 pcmcia_unregister_socket(&cf->socket); 340 pcmcia_unregister_socket(&cf->socket);
342 release_mem_region(io->start, io->end + 1 - io->start); 341 release_mem_region(io->start, resource_size(io));
343 iounmap((void __iomem *) cf->socket.io_offset); 342 iounmap((void __iomem *) cf->socket.io_offset);
344 if (board->irq_pin) { 343 if (board->irq_pin) {
345 free_irq(board->irq_pin, cf); 344 free_irq(board->irq_pin, cf);