diff options
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/maps/bfin-async-flash.c | 2 | ||||
-rw-r--r-- | drivers/mtd/maps/ixp2000.c | 11 | ||||
-rw-r--r-- | drivers/mtd/maps/pxa2xx-flash.c | 2 | ||||
-rw-r--r-- | drivers/mtd/nand/atmel_nand.c | 4 | ||||
-rw-r--r-- | drivers/mtd/nand/bcm_umi_nand.c | 2 | ||||
-rw-r--r-- | drivers/mtd/nand/mpc5121_nfc.c | 2 |
6 files changed, 12 insertions, 11 deletions
diff --git a/drivers/mtd/maps/bfin-async-flash.c b/drivers/mtd/maps/bfin-async-flash.c index d4297a97e100..67815eed2f00 100644 --- a/drivers/mtd/maps/bfin-async-flash.c +++ b/drivers/mtd/maps/bfin-async-flash.c | |||
@@ -142,7 +142,7 @@ static int __devinit bfin_flash_probe(struct platform_device *pdev) | |||
142 | state->map.write = bfin_flash_write; | 142 | state->map.write = bfin_flash_write; |
143 | state->map.copy_to = bfin_flash_copy_to; | 143 | state->map.copy_to = bfin_flash_copy_to; |
144 | state->map.bankwidth = pdata->width; | 144 | state->map.bankwidth = pdata->width; |
145 | state->map.size = memory->end - memory->start + 1; | 145 | state->map.size = resource_size(memory); |
146 | state->map.virt = (void __iomem *)memory->start; | 146 | state->map.virt = (void __iomem *)memory->start; |
147 | state->map.phys = memory->start; | 147 | state->map.phys = memory->start; |
148 | state->map.map_priv_1 = (unsigned long)state; | 148 | state->map.map_priv_1 = (unsigned long)state; |
diff --git a/drivers/mtd/maps/ixp2000.c b/drivers/mtd/maps/ixp2000.c index c00b9175ba9e..1594a802631d 100644 --- a/drivers/mtd/maps/ixp2000.c +++ b/drivers/mtd/maps/ixp2000.c | |||
@@ -155,7 +155,7 @@ static int ixp2000_flash_probe(struct platform_device *dev) | |||
155 | if (!plat) | 155 | if (!plat) |
156 | return -ENODEV; | 156 | return -ENODEV; |
157 | 157 | ||
158 | window_size = dev->resource->end - dev->resource->start + 1; | 158 | window_size = resource_size(dev->resource); |
159 | dev_info(&dev->dev, "Probe of IXP2000 flash(%d banks x %dMiB)\n", | 159 | dev_info(&dev->dev, "Probe of IXP2000 flash(%d banks x %dMiB)\n", |
160 | ixp_data->nr_banks, ((u32)window_size >> 20)); | 160 | ixp_data->nr_banks, ((u32)window_size >> 20)); |
161 | 161 | ||
@@ -194,16 +194,17 @@ static int ixp2000_flash_probe(struct platform_device *dev) | |||
194 | info->map.copy_to = ixp2000_flash_copy_to; | 194 | info->map.copy_to = ixp2000_flash_copy_to; |
195 | 195 | ||
196 | info->res = request_mem_region(dev->resource->start, | 196 | info->res = request_mem_region(dev->resource->start, |
197 | dev->resource->end - dev->resource->start + 1, | 197 | resource_size(dev->resource), |
198 | dev_name(&dev->dev)); | 198 | dev_name(&dev->dev)); |
199 | if (!info->res) { | 199 | if (!info->res) { |
200 | dev_err(&dev->dev, "Could not reserve memory region\n"); | 200 | dev_err(&dev->dev, "Could not reserve memory region\n"); |
201 | err = -ENOMEM; | 201 | err = -ENOMEM; |
202 | goto Error; | 202 | goto Error; |
203 | } | 203 | } |
204 | 204 | ||
205 | info->map.map_priv_1 = (unsigned long) ioremap(dev->resource->start, | 205 | info->map.map_priv_1 = |
206 | dev->resource->end - dev->resource->start + 1); | 206 | (unsigned long)ioremap(dev->resource->start, |
207 | resource_size(dev->resource)); | ||
207 | if (!info->map.map_priv_1) { | 208 | if (!info->map.map_priv_1) { |
208 | dev_err(&dev->dev, "Failed to ioremap flash region\n"); | 209 | dev_err(&dev->dev, "Failed to ioremap flash region\n"); |
209 | err = -EIO; | 210 | err = -EIO; |
diff --git a/drivers/mtd/maps/pxa2xx-flash.c b/drivers/mtd/maps/pxa2xx-flash.c index f59d62f74d44..7ae137d4b998 100644 --- a/drivers/mtd/maps/pxa2xx-flash.c +++ b/drivers/mtd/maps/pxa2xx-flash.c | |||
@@ -70,7 +70,7 @@ static int __devinit pxa2xx_flash_probe(struct platform_device *pdev) | |||
70 | info->map.name = (char *) flash->name; | 70 | info->map.name = (char *) flash->name; |
71 | info->map.bankwidth = flash->width; | 71 | info->map.bankwidth = flash->width; |
72 | info->map.phys = res->start; | 72 | info->map.phys = res->start; |
73 | info->map.size = res->end - res->start + 1; | 73 | info->map.size = resource_size(res); |
74 | info->parts = flash->parts; | 74 | info->parts = flash->parts; |
75 | info->nr_parts = flash->nr_parts; | 75 | info->nr_parts = flash->nr_parts; |
76 | 76 | ||
diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c index b300705d41cb..d4ba1f218e9a 100644 --- a/drivers/mtd/nand/atmel_nand.c +++ b/drivers/mtd/nand/atmel_nand.c | |||
@@ -513,7 +513,7 @@ static int __init atmel_nand_probe(struct platform_device *pdev) | |||
513 | 513 | ||
514 | host->io_phys = (dma_addr_t)mem->start; | 514 | host->io_phys = (dma_addr_t)mem->start; |
515 | 515 | ||
516 | host->io_base = ioremap(mem->start, mem->end - mem->start + 1); | 516 | host->io_base = ioremap(mem->start, resource_size(mem)); |
517 | if (host->io_base == NULL) { | 517 | if (host->io_base == NULL) { |
518 | printk(KERN_ERR "atmel_nand: ioremap failed\n"); | 518 | printk(KERN_ERR "atmel_nand: ioremap failed\n"); |
519 | res = -EIO; | 519 | res = -EIO; |
@@ -547,7 +547,7 @@ static int __init atmel_nand_probe(struct platform_device *pdev) | |||
547 | if (no_ecc) | 547 | if (no_ecc) |
548 | nand_chip->ecc.mode = NAND_ECC_NONE; | 548 | nand_chip->ecc.mode = NAND_ECC_NONE; |
549 | if (hard_ecc && regs) { | 549 | if (hard_ecc && regs) { |
550 | host->ecc = ioremap(regs->start, regs->end - regs->start + 1); | 550 | host->ecc = ioremap(regs->start, resource_size(regs)); |
551 | if (host->ecc == NULL) { | 551 | if (host->ecc == NULL) { |
552 | printk(KERN_ERR "atmel_nand: ioremap failed\n"); | 552 | printk(KERN_ERR "atmel_nand: ioremap failed\n"); |
553 | res = -EIO; | 553 | res = -EIO; |
diff --git a/drivers/mtd/nand/bcm_umi_nand.c b/drivers/mtd/nand/bcm_umi_nand.c index 9ec280738a9a..8c569e454dc5 100644 --- a/drivers/mtd/nand/bcm_umi_nand.c +++ b/drivers/mtd/nand/bcm_umi_nand.c | |||
@@ -380,7 +380,7 @@ static int __devinit bcm_umi_nand_probe(struct platform_device *pdev) | |||
380 | return -ENXIO; | 380 | return -ENXIO; |
381 | 381 | ||
382 | /* map physical address */ | 382 | /* map physical address */ |
383 | bcm_umi_io_base = ioremap(r->start, r->end - r->start + 1); | 383 | bcm_umi_io_base = ioremap(r->start, resource_size(r)); |
384 | 384 | ||
385 | if (!bcm_umi_io_base) { | 385 | if (!bcm_umi_io_base) { |
386 | printk(KERN_ERR "ioremap to access BCM UMI NAND chip failed\n"); | 386 | printk(KERN_ERR "ioremap to access BCM UMI NAND chip failed\n"); |
diff --git a/drivers/mtd/nand/mpc5121_nfc.c b/drivers/mtd/nand/mpc5121_nfc.c index 2f7c930872f9..eb1fbac63eb6 100644 --- a/drivers/mtd/nand/mpc5121_nfc.c +++ b/drivers/mtd/nand/mpc5121_nfc.c | |||
@@ -713,7 +713,7 @@ static int __devinit mpc5121_nfc_probe(struct platform_device *op) | |||
713 | } | 713 | } |
714 | 714 | ||
715 | regs_paddr = res.start; | 715 | regs_paddr = res.start; |
716 | regs_size = res.end - res.start + 1; | 716 | regs_size = resource_size(&res); |
717 | 717 | ||
718 | if (!devm_request_mem_region(dev, regs_paddr, regs_size, DRV_NAME)) { | 718 | if (!devm_request_mem_region(dev, regs_paddr, regs_size, DRV_NAME)) { |
719 | dev_err(dev, "Error requesting memory region!\n"); | 719 | dev_err(dev, "Error requesting memory region!\n"); |