Skip to contentSkip to conversation

commands/led.c: check registered LEDs

PATCH Applied Antony Pavlov 2 participants 2 messages Aug 2, 2011 – Aug 3, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 commands/led.c: check registered LEDs

---
 commands/led.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
commands/led.c +6 -0
index afb3fd3..774ba31 100644
@@ -37,6 +37,12 @@ static int do_led(struct command *cmdtp, int argc, char *argv[])
 	if (argc == 1) {
 		int i = 0;
 
+		led = led_by_number(i);
+		if (!led) {
+			printf("no registered LEDs\n");
+			return COMMAND_ERROR;
+		}
+
 		printf("registered LEDs:\n");
 
 		while ((led = led_by_number(i))) {
Signature · 7 lines
1.7.5.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Applied
#1 lore raw
Quoted 4 lines · Antony Pavlov
---
 commands/led.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

Applied to master.

Thanks,
Sascha

Quoted 27 lines
commands/led.c +6 -0
index afb3fd3..774ba31 100644
@@ -37,6 +37,12 @@ static int do_led(struct command *cmdtp, int argc, char *argv[])
 	if (argc == 1) {
 		int i = 0;
 
+		led = led_by_number(i);
+		if (!led) {
+			printf("no registered LEDs\n");
+			return COMMAND_ERROR;
+		}
+
 		printf("registered LEDs:\n");
 
 		while ((led = led_by_number(i))) {
Signature · 7 lines
1.7.5.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox