aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorHuang Shijie <b32955@freescale.com>2013-09-25 02:58:17 -0400
committerNitin Garg <nitin.garg@freescale.com>2014-04-16 09:06:07 -0400
commit8cfe6114defcc81c4cf3ca664ab23169d9338f14 (patch)
tree64cf11b24d561bc2e17634a3f0df16e1c825d3d2 /include/linux
parentcfa0895aa35f7be36cc4cf4e1951bb8bb4b69fb6 (diff)
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/linux')
-rw-r--r--include/linux/mtd/mtd.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index f9bfe526d310..88409b813418 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)
354 return mtd->_read_oob && mtd->_write_oob; 354 return mtd->_read_oob && mtd->_write_oob;
355} 355}
356 356
357static inline int mtd_type_is_nand(const struct mtd_info *mtd)
358{
359 return mtd->type == MTD_NANDFLASH || mtd->type == MTD_MLCNANDFLASH;
360}
361
357static inline int mtd_can_have_bb(const struct mtd_info *mtd) 362static inline int mtd_can_have_bb(const struct mtd_info *mtd)
358{ 363{
359 return !!mtd->_block_isbad; 364 return !!mtd->_block_isbad;