diff options
author | Brian Norris <computersforpeace@gmail.com> | 2012-06-22 16:35:39 -0700 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-09-29 14:50:50 +0100 |
commit | e47f68587b8255410e79166cbdecae290ca8a84e (patch) | |
tree | 6339788ba16b9fe05b0ce7dfcece57748aed4e07 /init | |
parent | 8bb8b85f6732ed579222a465d0749f66a3cace4d (diff) | |
download | linux-e47f68587b8255410e79166cbdecae290ca8a84e.tar.gz linux-e47f68587b8255410e79166cbdecae290ca8a84e.tar.bz2 linux-e47f68587b8255410e79166cbdecae290ca8a84e.zip |
mtd: check for max_bitflips in mtd_read_oob()
mtd_read_oob() has some unexpected similarities to mtd_read(). For
instance, when ops->datbuf != NULL, nand_base.c might return max_bitflips;
however, when ops->datbuf == NULL, nand_base's code potentially could
return -EUCLEAN (no in-tree drivers do this yet). In any case where the
driver might return max_bitflips, we should translate this into an
appropriate return code using the bitflip_threshold.
Essentially, mtd_read_oob() duplicates the logic from mtd_read().
This prevents users of mtd_read_oob() from receiving a positive return
value (i.e., from max_bitflips) and interpreting it as an unknown error.
Artem: amend comments.
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Reviewed-by: Mike Dunn <mikedunn@newsguy.com>
Reviewed-by: Shmulik Ladkani <shmulik.ladkani@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'init')
0 files changed, 0 insertions, 0 deletions