[PATCH 07/23] mtd: nand: omap: Fix hamming correct return values

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
---
 drivers/mtd/nand/nand_omap_gpmc.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/nand/nand_omap_gpmc.c b/drivers/mtd/nand/nand_omap_gpmc.c
index 8e29bae831..4ec4b93595 100644
--- a/drivers/mtd/nand/nand_omap_gpmc.c
+++ b/drivers/mtd/nand/nand_omap_gpmc.c
@@ -391,14 +391,13 @@ static int omap_correct_hamming(struct mtd_info *mtd, uint8_t *dat,
 			byte = (parity_bits >> 3) & 0x1FF;
 			/* Flip the bit to correct */
 			dat[byte] ^= (0x1 << bit);
+			return 1;
 		} else if (hm == 1) {
-			printf("Ecc is wrong\n");
 			/* ECC itself is corrupted */
-			return 2;
+			return -EBADMSG;
 		} else {
-			printf("bad compare! failed\n");
 			/* detected 2 bit error */
-			return -1;
+			return -EBADMSG;
 		}
 	}
 
-- 
2.19.1


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux