kernel/drivers/mtd/nand/spi/jsc.c
.. .. @@ -70,12 +70,13 @@ 70 70 static int js28u1gqscahg_ecc_get_status(struct spinand_device *spinand, 71 71 u8 status) 72 72 { 73 - u8 eccsr = (status & GENMASK(6, 4)) >> 2;73 + struct nand_device *nand = spinand_to_nand(spinand);74 + u8 eccsr = (status & GENMASK(6, 4)) >> 4;74 75 75 - if (eccsr <= 7)76 + if (eccsr < 4)76 77 return eccsr; 77 - else if (eccsr == 12)78 - return 8;78 + else if (eccsr == 4)79 + return nanddev_get_ecc_requirements(nand)->strength;79 80 else 80 81 return -EBADMSG; 81 82 }