diff options
author | Huang Shijie <b32955@freescale.com> | 2013-09-25 14:58:10 +0800 |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2013-10-27 16:27:04 -0700 |
commit | 1d0ed69ddd714b6e2a974f42896463366923ded6 (patch) | |
tree | 958946ae1a2823cea55b6a1a4d4e4417faa6896b /include | |
parent | 4ae7d228d6048d25a16bee209ebea24c5ecde825 (diff) |
mtd: nand: add a helper to check the SLC/MLC nand chip
Add a helper to check if a nand chip is SLC or MLC.
This helper makes the code more readable.
Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/mtd/nand.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 129548169400..5c05bab0ad89 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h @@ -795,4 +795,13 @@ static inline int onfi_get_sync_timing_mode(struct nand_chip *chip) return le16_to_cpu(chip->onfi_params.src_sync_timing_mode); } +/* + * Check if it is a SLC nand. + * The !nand_is_slc() can be used to check the MLC/TLC nand chips. + * We do not distinguish the MLC and TLC now. + */ +static inline bool nand_is_slc(struct nand_chip *chip) +{ + return !(chip->cellinfo & NAND_CI_CELLTYPE_MSK); +} #endif /* __LINUX_MTD_NAND_H */ |