From: Barry Song Date: Thu, 5 Aug 2010 15:07:42 +0000 (-0400) Subject: mtd: Blackfin NFC: make sure to check NAND_ALE in cmd_ctrl X-Git-Tag: v2.6.36-rc1~301^2~38 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=fd508da2208696db146cd1be2bb2e8b799f6e3a2;p=linux.git mtd: Blackfin NFC: make sure to check NAND_ALE in cmd_ctrl The NAND base may send some controls which are neither CLE nor ALE, so we need to explicitly check both instead of assuming things are always one or the other. Otherwise, we sometimes send out illegal addresses to the NAND device. Signed-off-by: Barry Song Signed-off-by: Mike Frysinger Signed-off-by: David Woodhouse --- diff --git a/drivers/mtd/nand/bf5xx_nand.c b/drivers/mtd/nand/bf5xx_nand.c index ca39819982bf..5c999e01db6f 100644 --- a/drivers/mtd/nand/bf5xx_nand.c +++ b/drivers/mtd/nand/bf5xx_nand.c @@ -203,7 +203,7 @@ static void bf5xx_nand_hwcontrol(struct mtd_info *mtd, int cmd, if (ctrl & NAND_CLE) bfin_write_NFC_CMD(cmd); - else + else if (ctrl & NAND_ALE) bfin_write_NFC_ADDR(cmd); SSYNC(); }