mtd: report all bad block as 1
authorYonghui Yu <yonghui.yu@amlogic.com>
Thu, 1 Jun 2017 10:46:32 +0000 (18:46 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Mon, 23 Oct 2017 06:49:48 +0000 (23:49 -0700)
commit3f92c04ffe8661c6eb24e7c2fd0420c3e0ab081f
tree81b65d8004724d009648820406c5f25f0750d1ce
parentdeca8a9c70292c0a33c16e5b463d2a2f64de0689
mtd: report all bad block as 1

PD#145359: mtd: report factory bad block as used bad one to mtd.

nandwrite in mtd utilies identify bad blocks by checking whether
return value of mtd_block_isbad is 1;
Our host driver need to distinguish used(1)/factory(FACTORY_BAD_BLOCK_ERROR)
bad block because partition table caculation cares factory bad ones only.

As mtd->_block_isbad is called by inside usage, so we normalize all the bad
block return value in mtd_block_isbad.

Change-Id: I19b0f25ce93ce527b6e02d59330b2edaf61020d4
Signed-off-by: Yonghui Yu <yonghui.yu@amlogic.com>
drivers/mtd/mtdcore.c