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