aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHuang Shijie <b32955@freescale.com>2013-08-20 13:58:36 +0800
committerBrian Norris <computersforpeace@gmail.com>2013-10-22 16:18:23 -0700
commit8e4c8259a59a62cec829edcbd2559006f57fc2aa (patch)
tree1e8a53e1539f4b5593c6df1ae1d5316c6353e3e4
parent9561080de23f6e254b7eb9b7556adf960dad58a3 (diff)
flash_otp_write: use helper to check the nand
Use the mtd_type_is_nand_user() helper to check if it is a NAND (including SLC/MLC). Signed-off-by: Huang Shijie <b32955@freescale.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
-rw-r--r--flash_otp_write.c4
1 files changed, 2 insertions, 2 deletions
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;