]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
mtd: nand: fix the wrong mtd->type for nand chip
authorHuang Shijie <b32955@freescale.com>
Wed, 25 Sep 2013 06:58:21 +0000 (14:58 +0800)
committerBrian Norris <computersforpeace@gmail.com>
Tue, 15 Oct 2013 20:56:47 +0000 (13:56 -0700)
commitafce773e69c2b19c02e5e20eace714dbd859abac
tree0cc862f02ea2c243469d061cc3b806569ece229b
parent44df32bfe847898505617d930b10cc82f1744ba8
mtd: nand: fix the wrong mtd->type for nand chip

Current code sets the mtd->type with MTD_NANDFLASH for both
SLC and MLC. So the jffs2 may supports the MLC nand, but in actually,
the jffs2 should not support the MLC.

This patch uses the nand_is_slc() to check the nand cell type,
and set the mtd->type with the right nand type.

After this patch, the jffs2 only supports the SLC nand.

The side-effect of this patch:
  Before this patch, the ioctl(MEMGETINFO) can only return with the
  MTD_NANDFLASH; but after this patch, the ioctl(MEMGETINFO) will
  return with the MTD_NANDFLASH for SLC, and MTD_MLCNANDFLASH for MLC.

  So the user applictions(such as mtd-utils) should also changes a little
  for this.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/nand/nand_base.c