Merge git://www.denx.de/git/u-boot
[oweals/u-boot.git] / board / esd / common / auto_update.c
index 62f6c204340bc00c5ea2dd52ab1bfc437273561b..a76b00fe4944dde27d2ca6e407e8cd08a29f09e8 100644 (file)
 
 #include <common.h>
 
-#if defined(CONFIG_CMD_NAND) && !defined(CFG_NAND_LEGACY)
-#warning CFG_NAND_LEGACY not defined in a file using the legacy NAND support!
-#endif
-
 #include <command.h>
 #include <image.h>
 #include <asm/byteorder.h>
+#if defined(CFG_NAND_LEGACY)
 #include <linux/mtd/nand_legacy.h>
+#endif
 #include <fat.h>
 #include <part.h>
 
@@ -294,6 +292,8 @@ int au_do_update(int i, long sz)
                        rc = nand_legacy_rw(nand_dev_desc, NANDRW_WRITE | NANDRW_JFFS2,
                                     start, nbytes, (size_t *)&total, (uchar *)addr);
                        debug ("nand_legacy_rw: ret=%x total=%d nbytes=%d\n", rc, total, nbytes);
+#else
+                       rc = -1;
 #endif
                }
                if (rc != 0) {