mtd: nand: Fix nanddev_neraseblocks()

nanddev_neraseblocks() currently returns the number pages per LUN
instead of the total number of eraseblocks.

Change-Id: Id5ec7cd7170dae28acbfa568941ffea8e8907361
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
This commit is contained in:
Jon Lin 2020-04-27 11:11:35 +08:00 committed by Jianhong Chen
parent 9b31ae46e2
commit 85c83705f8
1 changed files with 2 additions and 3 deletions

View File

@ -324,9 +324,8 @@ static inline unsigned int nanddev_ntargets(const struct nand_device *nand)
*/ */
static inline unsigned int nanddev_neraseblocks(const struct nand_device *nand) static inline unsigned int nanddev_neraseblocks(const struct nand_device *nand)
{ {
return (u64)nand->memorg.luns_per_target * return nand->memorg.ntargets * nand->memorg.luns_per_target *
nand->memorg.eraseblocks_per_lun * nand->memorg.eraseblocks_per_lun;
nand->memorg.pages_per_eraseblock;
} }
/** /**