]> www.infradead.org Git - mtd-utils.git/commitdiff
flash_otp_write: use helper to check the nand
authorHuang Shijie <b32955@freescale.com>
Tue, 20 Aug 2013 05:58:36 +0000 (13:58 +0800)
committerBrian Norris <computersforpeace@gmail.com>
Tue, 22 Oct 2013 23:18:23 +0000 (16:18 -0700)
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>
flash_otp_write.c

index eaca5e18cc3610db8ea1a502909e5f993cf236c9..111318ddb1722ef2ac59c3cca7ea0d646b8910a9 100644 (file)
@@ -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;