mtd: nand: ecc-bch: Return only valid error codes
authorMiquel Raynal <miquel.raynal@bootlin.com>
Tue, 29 Sep 2020 23:01:09 +0000 (01:01 +0200)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Mon, 30 Nov 2020 08:27:33 +0000 (09:27 +0100)
When a function is not available, returning -ENOTSUPP makes much more
sense than returning -1.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200929230124.31491-6-miquel.raynal@bootlin.com
include/linux/mtd/nand-ecc-sw-bch.h

index b62b8bd4669f595c70c9d1a99db58c8ee50490c5..d92d2abcfcef7b1493c5a5e6a8b299815d4f2b6e 100644 (file)
@@ -43,7 +43,7 @@ static inline int
 nand_bch_calculate_ecc(struct nand_chip *chip, const u_char *dat,
                       u_char *ecc_code)
 {
-       return -1;
+       return -ENOTSUPP;
 }
 
 static inline int