diff mbox

mtd: denali: use NAND_CI_CELLTYPE_MSK instead of hardcoded constant

Message ID 1374934193-21236-1-git-send-email-akinobu.mita@gmail.com
State Accepted
Commit 07cc0fbadb8bfcbba57c9035beece608ceee0bd3
Headers show

Commit Message

Akinobu Mita July 27, 2013, 2:09 p.m. UTC
Use NAND_CI_CELLTYPE_MSK to extract the cell type from nand_chip.cellinfo
instead of hardcoded constant.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Artem Bityutskiy <dedekind1@gmail.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: linux-mtd@lists.infradead.org
---
 drivers/mtd/nand/denali.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Brian Norris July 27, 2013, 7:06 p.m. UTC | #1
On Sat, Jul 27, 2013 at 7:09 AM, Akinobu Mita <akinobu.mita@gmail.com> wrote:
> Use NAND_CI_CELLTYPE_MSK to extract the cell type from nand_chip.cellinfo
> instead of hardcoded constant.
>
> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
> Cc: Artem Bityutskiy <dedekind1@gmail.com>
> Cc: David Woodhouse <dwmw2@infradead.org>
> Cc: linux-mtd@lists.infradead.org

Acked-by: Brian Norris <computersforpeace@gmail.com>

A comment not necessarily pertinent to this change: we don't set the
'cellinfo' field for ONFI chips, so this test for MLC won't be correct
for ONFI NAND.

Brian
Brian Norris Aug. 7, 2013, 8:14 a.m. UTC | #2
On Sat, Jul 27, 2013 at 11:09:53PM +0900, Akinobu Mita wrote:
> Use NAND_CI_CELLTYPE_MSK to extract the cell type from nand_chip.cellinfo
> instead of hardcoded constant.
> 
> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
> Cc: Artem Bityutskiy <dedekind1@gmail.com>
> Cc: David Woodhouse <dwmw2@infradead.org>
> Cc: linux-mtd@lists.infradead.org

Applied to l2-mtd.git. Thanks!

Brian
diff mbox

Patch

diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c
index 0c8bb6b..2ed2bb3 100644
--- a/drivers/mtd/nand/denali.c
+++ b/drivers/mtd/nand/denali.c
@@ -1520,7 +1520,7 @@  int denali_init(struct denali_nand_info *denali)
 	 * so just let controller do 15bit ECC for MLC and 8bit ECC for
 	 * SLC if possible.
 	 * */
-	if (denali->nand.cellinfo & 0xc &&
+	if (denali->nand.cellinfo & NAND_CI_CELLTYPE_MSK &&
 			(denali->mtd.oobsize > (denali->bbtskipbytes +
 			ECC_15BITS * (denali->mtd.writesize /
 			ECC_SECTOR_SIZE)))) {