From 818b97392932ac4cecc36ab839957258367004a9 Mon Sep 17 00:00:00 2001 From: Huang Shijie Date: Wed, 25 Sep 2013 14:58:17 +0800 Subject: 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 Signed-off-by: Brian Norris --- include/linux/mtd/mtd.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/linux/mtd/mtd.h') 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) 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; -- cgit