瀏覽代碼

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>
Boris Brezillon 9 年之前
父節點
當前提交
f8b04746a4
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/mtd/nand/sunxi_nand.c

+ 1 - 1
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