[U-Boot] [PATCH 4/6] cmd: led: add enum led_cmd member to support error code return

techping.chan at gmail.com techping.chan at gmail.com
Mon Mar 27 14:38:41 UTC 2017


From: Ziping Chen <techping.chan at gmail.com>

Add enum led_cmd member LED_CMD_ERROR, so that the enum can contain
the error code -1.

Signed-off-by: Ziping Chen <techping.chan at gmail.com>
---
 cmd/led.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/cmd/led.c b/cmd/led.c
index ef0ab1a..d50938a 100644
--- a/cmd/led.c
+++ b/cmd/led.c
@@ -62,7 +62,13 @@ static const led_tbl_t led_commands[] = {
 	{ NULL, 0, NULL, NULL, NULL }
 };
 
-enum led_cmd { LED_CMD_ON, LED_CMD_OFF, LED_CMD_TOGGLE, LED_CMD_BLINK };
+enum led_cmd {
+	LED_CMD_ERROR = -1,
+	LED_CMD_ON,
+	LED_CMD_OFF,
+	LED_CMD_TOGGLE,
+	LED_CMD_BLINK
+};
 
 enum led_cmd get_led_cmd(char *var)
 {
-- 
2.7.4



More information about the U-Boot mailing list