hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/drivers/mtd/nand/spi/unim.c
....@@ -69,12 +69,13 @@
6969 static int tx25g01_ecc_get_status(struct spinand_device *spinand,
7070 u8 status)
7171 {
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;
7374
74
- if (eccsr <= 7)
75
+ if (eccsr < 4)
7576 return eccsr;
76
- else if (eccsr == 12)
77
- return 8;
77
+ else if (eccsr == 4)
78
+ return nanddev_get_ecc_requirements(nand)->strength;
7879 else
7980 return -EBADMSG;
8081 }