Patchwork [for,mtd-utils,3/4] Use the mtd_type_is_nand_user() to check the nand

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

Comments

Huang Shijie - Aug. 20, 2013, 5:58 a.m.
Use this helper to check if it is a nand (including the SLC/MLC).

Signed-off-by: Huang Shijie <b32955@freescale.com>
---
 flash_otp_write.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/flash_otp_write.c b/flash_otp_write.c
index eaca5e1..111318d 100644
--- a/flash_otp_write.c
+++ b/flash_otp_write.c
@@ -78,7 +78,7 @@  int main(int argc,char *argv[])
 
 	printf("Writing OTP user data on %s at offset 0x%"PRIxoff_t"\n", argv[2], offset);
 
-	if (mtdInfo.type == MTD_NANDFLASH)
+	if (mtd_type_is_nand_user(&mtdInfo))
 		len = mtdInfo.writesize;
 	else
 		len = 256;
@@ -97,7 +97,7 @@  int main(int argc,char *argv[])
 		}
 		p = buf;
 		while (size > 0) {
-			if (mtdInfo.type == MTD_NANDFLASH) {
+			if (mtd_type_is_nand_user(&mtdInfo)) {
 				/* Fill remain buffers with 0xff */
 				memset(buf + size, 0xff, mtdInfo.writesize - size);
 				size = mtdInfo.writesize;