Patchwork [for,mtd-utils,1/4] add the MTD_MLCNANDFLASH case

login
register
mail settings
Submitter Huang Shijie
Date Aug. 20, 2013, 5:58 a.m.
Message ID <1376978317-28010-2-git-send-email-b32955@freescale.com>
Download mbox | patch
Permalink /patch/268368/
State Accepted
Commit 2e4fe96b2bc5ad33793d0d5cbeb23c9f76155211
Headers show

Comments

Huang Shijie - Aug. 20, 2013, 5:58 a.m.
The MTD_MLCNANDFLASH case is missed in the current code.
This patch adds it.

Signed-off-by: Huang Shijie <b32955@freescale.com>
---
 lib/libmtd.c        |    2 ++
 lib/libmtd_legacy.c |    3 +++
 mtd_debug.c         |    3 +++
 3 files changed, 8 insertions(+), 0 deletions(-)

Patch

diff --git a/lib/libmtd.c b/lib/libmtd.c
index 654490e..3e8109a 100644
--- a/lib/libmtd.c
+++ b/lib/libmtd.c
@@ -403,6 +403,8 @@  static int type_str2int(const char *str)
 {
 	if (!strcmp(str, "nand"))
 		return MTD_NANDFLASH;
+	if (!strcmp(str, "mlc-nand"))
+		return MTD_MLCNANDFLASH;
 	if (!strcmp(str, "nor"))
 		return MTD_NORFLASH;
 	if (!strcmp(str, "rom"))
diff --git a/lib/libmtd_legacy.c b/lib/libmtd_legacy.c
index 1ae9946..233a92e 100644
--- a/lib/libmtd_legacy.c
+++ b/lib/libmtd_legacy.c
@@ -322,6 +322,9 @@  int legacy_get_dev_info(const char *node, struct mtd_dev_info *mtd)
 	case MTD_NANDFLASH:
 		strcpy((char *)mtd->type_str, "nand");
 		break;
+	case MTD_MLCNANDFLASH:
+		strcpy((char *)mtd->type_str, "mlc-nand");
+		break;
 	case MTD_DATAFLASH:
 		strcpy((char *)mtd->type_str, "dataflash");
 		break;
diff --git a/mtd_debug.c b/mtd_debug.c
index 9110e9b..d6993ce 100644
--- a/mtd_debug.c
+++ b/mtd_debug.c
@@ -260,6 +260,9 @@  int showinfo(int fd)
 		case MTD_NANDFLASH:
 			printf("MTD_NANDFLASH");
 			break;
+		case MTD_MLCNANDFLASH:
+			printf("MTD_MLCNANDFLASH");
+			break;
 		case MTD_DATAFLASH:
 			printf("MTD_DATAFLASH");
 			break;