Subject: ARM: OMAP3: Use omap_nand_switch_ecc only if needed From: Dirk Behme Use omap_nand_switch_ecc() logic only on OMAP3 boards that need this. Don't use it for all other boards. Signed-off-by: Dirk Behme --- Index: u-boot_steve/common/cmd_nand.c =================================================================== --- u-boot_steve.orig/common/cmd_nand.c +++ u-boot_steve/common/cmd_nand.c @@ -40,8 +40,6 @@ int find_dev_and_part(const char *id, st #if defined(CONFIG_OMAP) && (defined(CONFIG_OMAP3_BEAGLE)) extern void omap_nand_switch_ecc(nand_info_t *nand, int hardware); -#else -#define omap_nand_switch_ecc(x, y) do {} while(0) #endif static int nand_dump(nand_info_t *nand, ulong off, int only_oob) @@ -324,6 +322,7 @@ int do_nand(cmd_tbl_t * cmdtp, int flag, } +#if defined(CONFIG_OMAP) && (defined(CONFIG_OMAP3_BEAGLE)) if (strncmp(cmd, "ecc", 3) == 0) { if (argc < 2) goto usage; @@ -336,6 +335,7 @@ int do_nand(cmd_tbl_t * cmdtp, int flag, return 0; } +#endif /* read write */ if (strncmp(cmd, "read", 4) == 0 || strncmp(cmd, "write", 5) == 0) { @@ -503,7 +503,9 @@ U_BOOT_CMD(nand, 5, 1, do_nand, "nand scrub - really clean NAND erasing bad blocks (UNSAFE)\n" "nand markbad off - mark bad block at offset (UNSAFE)\n" "nand biterr off - make a bit error at offset (UNSAFE)\n" - "nand ecc [hw/sw] - switch the ecc calculation algorithm \n" +#if defined(CONFIG_OMAP) && (defined(CONFIG_OMAP3_BEAGLE)) + "nand ecc [hw/sw] - switch the ecc calculation algorithm \n" +#endif "nand lock [tight] [status]\n" " bring nand to lock state or display locked pages\n" "nand unlock [offset] [size] - unlock section\n");