diff options
author | Dmitry Lavnikevich <d.lavnikevich@sam-solutions.com> | 2014-03-10 14:39:49 +0300 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2014-03-12 21:26:37 +0100 |
commit | 1ee640765a71a7b9ee2cf4ebad22ed5961aef8db (patch) | |
tree | b41e5eefa1033297be8f1713fbcdacfa58e3aebc /drivers/mtd/mtdoob.c | |
parent | cf1b29a8504c83bb1922e249c2293a3ecd2920da (diff) | |
download | barebox-1ee640765a71a7b9ee2cf4ebad22ed5961aef8db.tar.gz barebox-1ee640765a71a7b9ee2cf4ebad22ed5961aef8db.tar.xz |
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.
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 (mtd_div_by_wb,
mtd_div_by_eb may be used in some of such cases).
Was tested on phyFLEX i.MX6.
Signed-off-by: Dmitry Lavnikevich <d.lavnikevich@sam-solutions.com>
Signed-off-by: Grigory Milev <g.milev@sam-solutions.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/mtd/mtdoob.c')
-rw-r--r-- | drivers/mtd/mtdoob.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/mtdoob.c b/drivers/mtd/mtdoob.c index b9cac2ae69..10d17e90d2 100644 --- a/drivers/mtd/mtdoob.c +++ b/drivers/mtd/mtdoob.c @@ -78,7 +78,7 @@ static int add_mtdoob_device(struct mtd_info *mtd, char *devname, void **priv) mtdoob = xzalloc(sizeof(*mtdoob)); mtdoob->cdev.ops = &mtd_ops_oob; - mtdoob->cdev.size = (mtd->size / mtd->writesize) * mtd->oobsize; + mtdoob->cdev.size = mtd_div_by_wb(mtd->size, mtd) * mtd->oobsize; mtdoob->cdev.name = asprintf("%s_oob%d", devname, mtd->class_dev.id); mtdoob->cdev.priv = mtdoob; mtdoob->cdev.dev = &mtd->class_dev; |