mtd: rawnand: mtk: Add validity check for CE# pin setting
authorXiaolei Li <xiaolei.li@mediatek.com>
Tue, 7 May 2019 10:25:40 +0000 (18:25 +0800)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Thu, 27 Jun 2019 18:05:25 +0000 (20:05 +0200)
commit8dbd7b103fc3eac53ab8a20b3cd1a5cb26c0dcbb
tree88ba4cf4675f9f2be20d421e4e252b2a41e8ca5e
parent42d13a09efa4f0ea33231f3b145356ee487987b3
mtd: rawnand: mtk: Add validity check for CE# pin setting

Currently, we only check how many CE# pins are set in device tree.
But it should be necessary to check whether CE# pin setting is
duplicated or if CE# pin index exceeds the maximum CE# number that
controller supports.

So, add validity check to avoid these invalid settings.

Signed-off-by: Xiaolei Li <xiaolei.li@mediatek.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/nand/raw/mtk_nand.c