diff options
author | Huang Shijie <b32955@freescale.com> | 2013-09-25 02:58:10 -0400 |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2013-10-27 19:27:04 -0400 |
commit | 1d0ed69ddd714b6e2a974f42896463366923ded6 (patch) | |
tree | 958946ae1a2823cea55b6a1a4d4e4417faa6896b /include/linux/mtd | |
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/linux/mtd')
-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) | |||
795 | return le16_to_cpu(chip->onfi_params.src_sync_timing_mode); | 795 | return le16_to_cpu(chip->onfi_params.src_sync_timing_mode); |
796 | } | 796 | } |
797 | 797 | ||
798 | /* | ||
799 | * Check if it is a SLC nand. | ||
800 | * The !nand_is_slc() can be used to check the MLC/TLC nand chips. | ||
801 | * We do not distinguish the MLC and TLC now. | ||
802 | */ | ||
803 | static inline bool nand_is_slc(struct nand_chip *chip) | ||
804 | { | ||
805 | return !(chip->cellinfo & NAND_CI_CELLTYPE_MSK); | ||
806 | } | ||
798 | #endif /* __LINUX_MTD_NAND_H */ | 807 | #endif /* __LINUX_MTD_NAND_H */ |