diff options
Diffstat (limited to 'commands/gpio.c')
-rw-r--r-- | commands/gpio.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/commands/gpio.c b/commands/gpio.c index d04fd65bc8..caabb5adc0 100644 --- a/commands/gpio.c +++ b/commands/gpio.c @@ -10,8 +10,8 @@ static int get_gpio_and_value(int argc, char *argv[], int *gpio, int *value) { struct gpio_chip *chip = NULL; - struct device_d *dev; - int count = 2; + struct device *dev; + int count = 1; int ret = 0; int opt; @@ -34,7 +34,7 @@ static int get_gpio_and_value(int argc, char *argv[], if (value) count++; - if (optind < count) + if (argc < optind + count) return COMMAND_ERROR_USAGE; *gpio = gpio_find_by_name(argv[optind]); |