From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gXoHg-00005f-1I for barebox@lists.infradead.org; Fri, 14 Dec 2018 14:17:47 +0000 From: Sascha Hauer Date: Fri, 14 Dec 2018 15:17:14 +0100 Message-Id: <20181214141730.26181-8-s.hauer@pengutronix.de> In-Reply-To: <20181214141730.26181-1-s.hauer@pengutronix.de> References: <20181214141730.26181-1-s.hauer@pengutronix.de> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 07/23] mtd: nand: omap: Fix hamming correct return values To: Barebox List Signed-off-by: Sascha Hauer --- 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@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox