diff options
-rw-r--r-- | drivers/mtd/mtdpart.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c index 02ce38fb1fc3..29675edb44b4 100644 --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c | |||
@@ -48,8 +48,11 @@ static int part_read(struct mtd_info *mtd, loff_t from, size_t len, | |||
48 | size_t *retlen, u_char *buf) | 48 | size_t *retlen, u_char *buf) |
49 | { | 49 | { |
50 | struct mtd_part *part = PART(mtd); | 50 | struct mtd_part *part = PART(mtd); |
51 | struct mtd_ecc_stats stats; | ||
51 | int res; | 52 | int res; |
52 | 53 | ||
54 | stats = part->master->ecc_stats; | ||
55 | |||
53 | if (from >= mtd->size) | 56 | if (from >= mtd->size) |
54 | len = 0; | 57 | len = 0; |
55 | else if (from + len > mtd->size) | 58 | else if (from + len > mtd->size) |
@@ -58,9 +61,9 @@ static int part_read(struct mtd_info *mtd, loff_t from, size_t len, | |||
58 | len, retlen, buf); | 61 | len, retlen, buf); |
59 | if (unlikely(res)) { | 62 | if (unlikely(res)) { |
60 | if (res == -EUCLEAN) | 63 | if (res == -EUCLEAN) |
61 | mtd->ecc_stats.corrected++; | 64 | mtd->ecc_stats.corrected += part->master->ecc_stats.corrected - stats.corrected; |
62 | if (res == -EBADMSG) | 65 | if (res == -EBADMSG) |
63 | mtd->ecc_stats.failed++; | 66 | mtd->ecc_stats.failed += part->master->ecc_stats.failed - stats.failed; |
64 | } | 67 | } |
65 | return res; | 68 | return res; |
66 | } | 69 | } |