diff options
-rw-r--r-- | drivers/mtd/nand/mxc_nd2.c | 4 | ||||
-rw-r--r-- | drivers/mtd/nand/mxc_nd2.h | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/drivers/mtd/nand/mxc_nd2.c b/drivers/mtd/nand/mxc_nd2.c index 702f6a1e3de4..2840d4ca4adf 100644 --- a/drivers/mtd/nand/mxc_nd2.c +++ b/drivers/mtd/nand/mxc_nd2.c @@ -397,7 +397,7 @@ static void mxc_nand_enable_hwecc(struct mtd_info *mtd, int mode) */ static int mxc_check_ecc_status(struct mtd_info *mtd) { - u16 ecc_stat, err; + u32 ecc_stat, err; int no_subpages = 1; int ret = 0; u8 ecc_bit_mask, err_limit; @@ -407,7 +407,7 @@ static int mxc_check_ecc_status(struct mtd_info *mtd) no_subpages = mtd->writesize >> 9; - ecc_stat = raw_read(REG_NFC_ECC_STATUS_RESULT); + ecc_stat = GET_NFC_ECC_STATUS(); do { err = ecc_stat & ecc_bit_mask; if (err > err_limit) { diff --git a/drivers/mtd/nand/mxc_nd2.h b/drivers/mtd/nand/mxc_nd2.h index de661a674d02..bcd31a061089 100644 --- a/drivers/mtd/nand/mxc_nd2.h +++ b/drivers/mtd/nand/mxc_nd2.h @@ -148,6 +148,8 @@ #endif +#define GET_NFC_ECC_STATUS() raw_read(REG_NFC_ECC_STATUS_RESULT); + /*! * Set 1 to specific operation bit, rest to 0 in LAUNCH_NFC Register for * Specific operation @@ -305,6 +307,9 @@ #define WRITE_NFC_IP_REG(val,reg) \ raw_write((raw_read(REG_NFC_OPS_STAT) & ~NFC_OPS_STAT), REG_NFC_OPS_STAT) + +#define GET_NFC_ECC_STATUS() raw_read(REG_NFC_ECC_STATUS_RESULT); + /*! * Set INT to 0, Set 1 to specific operation bit, rest to 0 in LAUNCH_NFC Register for * Specific operation |