[PATCH] mtd: nand: fix nand helper function

From: Peter Pan
Date: Thu Jun 16 2016 - 22:31:59 EST


nand_page_size() and nand_eraseblock_to_offs() return
fault value. Fix them.

Signed-off-by: Peter Pan <peterpandong@xxxxxxxxxx>
---
include/linux/mtd/nand.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 583eb40..ffee2a7 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -162,7 +162,7 @@ static inline size_t nand_pages_to_len(struct
nand_device *nand, int npages)
*/
static inline size_t nand_page_size(struct nand_device *nand)
{
- return nand->memorg.eraseblocksize;
+ return nand->memorg.pagesize;
}

/**
@@ -197,7 +197,7 @@ static inline size_t nand_eraseblock_size(struct
nand_device *nand)
static inline loff_t nand_eraseblock_to_offs(struct nand_device *nand,
int block)
{
- return (loff_t)nand->memorg.pagesize * block;
+ return (loff_t)nand->memorg.eraseblocksize * block;
}

/**
--
1.9.1


>
> Thanks
> Peter Pan