[MTD] [NAND] Replace -1 with -EBADMSG in nand error correction code
Magic numerical values are just bad style. Particularly so when undocumented. Signed-off-by: Jörn Engel <joern@logfs.org> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
This commit is contained in:
committed by
David Woodhouse
parent
1dd7fdb163
commit
eb68450715
@@ -220,7 +220,7 @@ static int doc_ecc_decode(struct rs_control *rs, uint8_t *data, uint8_t *ecc)
|
||||
}
|
||||
}
|
||||
/* If the parity is wrong, no rescue possible */
|
||||
return parity ? -1 : nerr;
|
||||
return parity ? -EBADMSG : nerr;
|
||||
}
|
||||
|
||||
static void DoC_Delay(struct doc_priv *doc, unsigned short cycles)
|
||||
@@ -1034,7 +1034,7 @@ static int doc200x_correct_data(struct mtd_info *mtd, u_char *dat,
|
||||
WriteDOC(DOC_ECC_DIS, docptr, Mplus_ECCConf);
|
||||
else
|
||||
WriteDOC(DOC_ECC_DIS, docptr, ECCConf);
|
||||
if (no_ecc_failures && (ret == -1)) {
|
||||
if (no_ecc_failures && (ret == -EBADMSG)) {
|
||||
printk(KERN_ERR "suppressing ECC failure\n");
|
||||
ret = 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user