]> www.infradead.org Git - mtd-utils.git/commitdiff
mtd: mtd-abi: add a helper to detect the nand type
authorHuang Shijie <b32955@freescale.com>
Tue, 20 Aug 2013 05:58:35 +0000 (13:58 +0800)
committerBrian Norris <computersforpeace@gmail.com>
Tue, 22 Oct 2013 23:18:19 +0000 (16:18 -0700)
The helper is for user applications, and it is just a copy of
the kernel helper: mtd_type_is_nand();

Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
include/mtd/mtd-abi.h

index 4de167bf0c97958787f2900c3334bc72622a8efd..bcd749692f51015d86de1dd8e74a259d08225519 100644 (file)
@@ -274,4 +274,9 @@ enum mtd_file_modes {
        MTD_FILE_MODE_RAW,
 };
 
+static inline int mtd_type_is_nand_user(const struct mtd_info_user *mtd)
+{
+       return mtd->type == MTD_NANDFLASH || mtd->type == MTD_MLCNANDFLASH;
+}
+
 #endif /* __MTD_ABI_H__ */