mtd: rawnand: Don't overwrite the error code from nand_set_ecc_soft_ops()
authorTudor Ambarus <tudor.ambarus@microchip.com>
Thu, 17 Sep 2020 07:52:13 +0000 (10:52 +0300)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Wed, 30 Sep 2020 14:44:17 +0000 (16:44 +0200)
The error code received from nand_set_ecc_soft_ops() was overwritten,
drop this redundant assignment and use the error code received from
the callee.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200917075213.532161-4-tudor.ambarus@microchip.com
drivers/mtd/nand/raw/nand_base.c

index c7f4ba9..1f0d542 100644 (file)
@@ -5698,10 +5698,8 @@ static int nand_scan_tail(struct nand_chip *chip)
 
        case NAND_ECC_ENGINE_TYPE_SOFT:
                ret = nand_set_ecc_soft_ops(chip);
-               if (ret) {
-                       ret = -EINVAL;
+               if (ret)
                        goto err_nand_manuf_cleanup;
-               }
                break;
 
        case NAND_ECC_ENGINE_TYPE_ON_DIE: