summaryrefslogtreecommitdiff
path: root/drivers/mtd/nand
diff options
context:
space:
mode:
authorHan Xu <han.xu@nxp.com>2016-04-13 01:06:33 +0300
committerBoris Brezillon <boris.brezillon@free-electrons.com>2016-09-23 10:35:16 +0300
commit1848a057a29f74d2a0517c5123a281002739ba31 (patch)
tree02514e0082e7755ad96423afd2ebe06948669977 /drivers/mtd/nand
parent3fe4f900bf3061b3994c56eea497d8a839241277 (diff)
downloadlinux-1848a057a29f74d2a0517c5123a281002739ba31.tar.xz
mtd: nand: gpmi: get correct free oob space
change the way to calculate pagesize to get correct free oob space for legacy_set_geometry function. Signed-off-by: Han Xu <han.xu@nxp.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Diffstat (limited to 'drivers/mtd/nand')
-rw-r--r--drivers/mtd/nand/gpmi-nand/gpmi-nand.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
index 6e461560c6a8..6c062b8251d2 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
@@ -318,7 +318,8 @@ static int legacy_set_geometry(struct gpmi_nand_data *this)
return -EINVAL;
}
- geo->page_size = mtd->writesize + mtd->oobsize;
+ geo->page_size = mtd->writesize + geo->metadata_size +
+ (geo->gf_len * geo->ecc_strength * geo->ecc_chunk_count) / 8;
geo->payload_size = mtd->writesize;
/*