[U-Boot] [PATCH] cmd_i2c: Update available commands when CONFIG_I2C_CMD_TREE is defined

Peter Tyser ptyser at xes-inc.com
Wed Oct 1 19:58:57 CEST 2008


If CONFIG_I2C_CMD_TREE is defined, individual i2c commands such as
'imd', 'imm', 'imw', etc should not be available as their functionality
is duplicated in the 'i2c' command.

Signed-off-by: Peter Tyser <ptyser at xes-inc.com>
---
 common/cmd_i2c.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c
index ea80e8a..8a3cf10 100644
--- a/common/cmd_i2c.c
+++ b/common/cmd_i2c.c
@@ -1248,11 +1248,9 @@ int do_i2c(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 		printf ("Usage:\n%s\n", cmdtp->usage);
 	return 0;
 }
-#endif  /* CONFIG_I2C_CMD_TREE */
 
 /***************************************************/
 
-#if defined(CONFIG_I2C_CMD_TREE)
 U_BOOT_CMD(
 	i2c, 6, 1, do_i2c,
 	"i2c     - I2C sub-system\n",
@@ -1271,7 +1269,7 @@ U_BOOT_CMD(
 	"i2c sdram chip - print SDRAM configuration information\n"
 #endif
 );
-#endif /* CONFIG_I2C_CMD_TREE */
+#else /* !CONFIG_I2C_CMD_TREE */
 U_BOOT_CMD(
 	imd,	4,	1,	do_i2c_md,		\
 	"imd     - i2c memory display\n",				\
@@ -1326,3 +1324,4 @@ U_BOOT_CMD(
 	"      (valid chip values 50..57)\n"
 );
 #endif
+#endif /* CONFIG_I2C_CMD_TREE */
-- 
1.6.0.2.GIT



More information about the U-Boot mailing list