diff options
author | Huang Shijie <b32955@freescale.com> | 2013-09-25 06:58:17 (GMT) |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2013-10-27 23:27:06 (GMT) |
commit | 818b97392932ac4cecc36ab839957258367004a9 (patch) | |
tree | 9d3d864da226e7068ece1b88ccf8b51b9fb25e4d /include | |
parent | fda5b0e24dca3d52671e5a6543a285d4e86c55e1 (diff) | |
download | linux-fsl-qoriq-818b97392932ac4cecc36ab839957258367004a9.tar.xz |
mtd: nand: add a helper to detect the nand type
This helper detects that whether the mtd's type is nand type.
Now, it's clear that the MTD_NANDFLASH stands for SLC nand only.
So use the mtd_type_is_nand() to replace the old check method
to do the nand type (include the SLC and MLC) check.
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/mtd.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index f9bfe52..88409b8 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h @@ -354,6 +354,11 @@ static inline int mtd_has_oob(const struct mtd_info *mtd) return mtd->_read_oob && mtd->_write_oob; } +static inline int mtd_type_is_nand(const struct mtd_info *mtd) +{ + return mtd->type == MTD_NANDFLASH || mtd->type == MTD_MLCNANDFLASH; +} + static inline int mtd_can_have_bb(const struct mtd_info *mtd) { return !!mtd->_block_isbad; |