Merge branch 'denx-coldfire' into coldfire-aug2007
[oweals/u-boot.git] / board / esd / common / auto_update.c
index f7ff3c96faf0be3388b6ce68550a9584b29ec835..da147ee5508c047b930a10c9b3f1354f7479e0f0 100644 (file)
@@ -31,7 +31,9 @@
 #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>
 
@@ -40,7 +42,7 @@
 #ifdef CONFIG_AUTO_UPDATE
 
 #if !defined(CONFIG_CMD_FAT)
-#error "must define CFG_CMD_FAT"
+#error "must define CONFIG_CMD_FAT"
 #endif
 
 extern au_image_t au_image[];
@@ -294,6 +296,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) {