hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/drivers/mtd/nand/spi/jsc.c
....@@ -70,12 +70,13 @@
7070 static int js28u1gqscahg_ecc_get_status(struct spinand_device *spinand,
7171 u8 status)
7272 {
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;
7475
75
- if (eccsr <= 7)
76
+ if (eccsr < 4)
7677 return eccsr;
77
- else if (eccsr == 12)
78
- return 8;
78
+ else if (eccsr == 4)
79
+ return nanddev_get_ecc_requirements(nand)->strength;
7980 else
8081 return -EBADMSG;
8182 }