aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/maps/scb2_flash.c
diff options
context:
space:
mode:
authorAdrian Hunter <ext-adrian.hunter@nokia.com>2008-12-10 08:37:21 -0500
committerDavid Woodhouse <David.Woodhouse@intel.com>2008-12-10 08:37:21 -0500
commit69423d99fc182a81f3c5db3eb5c140acc6fc64be (patch)
tree5f1818e6fb69388f0da276152646bf0597e318c0 /drivers/mtd/maps/scb2_flash.c
parent8a4c2495b142fe612b291a810d9e695f269c26db (diff)
[MTD] update internal API to support 64-bit device size
MTD internal API presently uses 32-bit values to represent device size. This patch updates them to 64-bits but leaves the external API unchanged. Extending the external API is a separate issue for several reasons. First, no one needs it at the moment. Secondly, whether the implementation is done with IOCTLs, sysfs or both is still debated. Thirdly external API changes require the internal API to be accepted first. Note that although the MTD API will be able to support 64-bit device sizes, existing drivers do not and are not required to do so, although NAND base has been updated. In general, changing from 32-bit to 64-bit values cause little or no changes to the majority of the code with the following exceptions: - printk message formats - division and modulus of 64-bit values - NAND base support - 32-bit local variables used by mtdpart and mtdconcat - naughtily assuming one structure maps to another in MEMERASE ioctl Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/maps/scb2_flash.c')
-rw-r--r--drivers/mtd/maps/scb2_flash.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/mtd/maps/scb2_flash.c b/drivers/mtd/maps/scb2_flash.c
index 21169e6d646c..7e329f09a548 100644
--- a/drivers/mtd/maps/scb2_flash.c
+++ b/drivers/mtd/maps/scb2_flash.c
@@ -118,7 +118,8 @@ scb2_fixup_mtd(struct mtd_info *mtd)
118 struct mtd_erase_region_info *region = &mtd->eraseregions[i]; 118 struct mtd_erase_region_info *region = &mtd->eraseregions[i];
119 119
120 if (region->numblocks * region->erasesize > mtd->size) { 120 if (region->numblocks * region->erasesize > mtd->size) {
121 region->numblocks = (mtd->size / region->erasesize); 121 region->numblocks = ((unsigned long)mtd->size /
122 region->erasesize);
122 done = 1; 123 done = 1;
123 } else { 124 } else {
124 region->numblocks = 0; 125 region->numblocks = 0;
@@ -187,8 +188,9 @@ scb2_flash_probe(struct pci_dev *dev, const struct pci_device_id *ent)
187 return -ENODEV; 188 return -ENODEV;
188 } 189 }
189 190
190 printk(KERN_NOTICE MODNAME ": chip size 0x%x at offset 0x%x\n", 191 printk(KERN_NOTICE MODNAME ": chip size 0x%llx at offset 0x%llx\n",
191 scb2_mtd->size, SCB2_WINDOW - scb2_mtd->size); 192 (unsigned long long)scb2_mtd->size,
193 (unsigned long long)(SCB2_WINDOW - scb2_mtd->size));
192 194
193 add_mtd_device(scb2_mtd); 195 add_mtd_device(scb2_mtd);
194 196