From: Brian Norris Date: Fri, 22 Jun 2012 23:35:39 +0000 (-0700) Subject: mtd: check for max_bitflips in mtd_read_oob() X-Git-Tag: v3.7-rc1~70^2~107 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e47f68587b8255410e79166cbdecae290ca8a84e;p=pandora-kernel.git 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 Reviewed-by: Mike Dunn Reviewed-by: Shmulik Ladkani Signed-off-by: Artem Bityutskiy Signed-off-by: David Woodhouse --- Reading git-diff-tree failed