hc
2023-11-06 9df731a176aab8e03b984b681b1bea01ccff6644
u-boot/drivers/mtd/nand/spi/jsc.c
....@@ -72,12 +72,13 @@
7272 static int js28u1gqscahg_ecc_get_status(struct spinand_device *spinand,
7373 u8 status)
7474 {
75
- u8 eccsr = (status & GENMASK(6, 4)) >> 2;
75
+ struct nand_device *nand = spinand_to_nand(spinand);
76
+ u8 eccsr = (status & GENMASK(6, 4)) >> 4;
7677
77
- if (eccsr <= 7)
78
+ if (eccsr < 4)
7879 return eccsr;
79
- else if (eccsr == 12)
80
- return 8;
80
+ else if (eccsr == 4)
81
+ return nand->eccreq.strength;
8182 else
8283 return -EBADMSG;
8384 }