diff options
author | Boris Brezillon <boris.brezillon@free-electrons.com> | 2016-03-04 17:25:08 +0100 |
---|---|---|
committer | Boris Brezillon <boris.brezillon@free-electrons.com> | 2016-04-19 22:05:41 +0200 |
commit | f8b04746a4ba389d609b5ddcfbf95835c7dfcb31 (patch) | |
tree | 8f4262c2a4ee2920075e90ea9eac397bfd82b12a /drivers/mtd/nand/sunxi_nand.c | |
parent | mtd: nand: sunxi: let the NAND controller control the CE line (diff) | |
download | linux-f8b04746a4ba389d609b5ddcfbf95835c7dfcb31.tar.xz linux-f8b04746a4ba389d609b5ddcfbf95835c7dfcb31.zip |
mtd: nand: sunxi: fix the NFC_ECC_ERR_CNT() macro
NFC_ECC_ERR_CNT() is not taking into account the case when the NAND chip
contains more than 4 ECC blocks (NANDs with 4kB+ pages).
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Diffstat (limited to 'drivers/mtd/nand/sunxi_nand.c')
-rw-r--r-- | drivers/mtd/nand/sunxi_nand.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/nand/sunxi_nand.c b/drivers/mtd/nand/sunxi_nand.c index 4dcc0e42e0ef..4cb5c6f866ff 100644 --- a/drivers/mtd/nand/sunxi_nand.c +++ b/drivers/mtd/nand/sunxi_nand.c @@ -154,7 +154,7 @@ /* define bit use in NFC_ECC_ST */ #define NFC_ECC_ERR(x) BIT(x) #define NFC_ECC_PAT_FOUND(x) BIT(x + 16) -#define NFC_ECC_ERR_CNT(b, x) (((x) >> ((b) * 8)) & 0xff) +#define NFC_ECC_ERR_CNT(b, x) (((x) >> (((b) % 4) * 8)) & 0xff) #define NFC_DEFAULT_TIMEOUT_MS 1000 |