mtd: mtd-abi: add a helper to detect the nand type

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Wed Nov 13 13:59:03 EST 2013


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=4f8a3ba700b882f61d4cea2d68a8f83fa93c6dfd
Commit:     4f8a3ba700b882f61d4cea2d68a8f83fa93c6dfd
Parent:     818b97392932ac4cecc36ab839957258367004a9
Author:     Huang Shijie <b32955 at freescale.com>
AuthorDate: Wed Sep 25 14:58:18 2013 +0800
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Sun Oct 27 16:27:06 2013 -0700

    mtd: mtd-abi: add a helper to detect the nand type
    
    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 at freescale.com>
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
 include/uapi/mtd/mtd-abi.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/uapi/mtd/mtd-abi.h b/include/uapi/mtd/mtd-abi.h
index e89b096..e272ea0 100644
--- a/include/uapi/mtd/mtd-abi.h
+++ b/include/uapi/mtd/mtd-abi.h
@@ -275,4 +275,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__ */



More information about the linux-mtd-cvs mailing list