Currently the error handling of gpio_get_num() checks the return value of the previous of_property_read_u32_index() which has it's own error check. Fix it by using the correct return value variable. Fixes: 37e6bee7e5 ("gpiolib: Add support for GPIO "hog" nodes") Signed-off-by: Marco Felsch <m.felsch@xxxxxxxxxxxxxx> --- drivers/gpio/gpiolib.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index b83a27de7d..4e0bf73742 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -352,12 +352,12 @@ static int of_hog_gpio(struct device_node *np, struct gpio_chip *chip, flags |= GPIOF_ACTIVE_LOW; gpio = gpio_get_num(chip->dev, gpio_num); - if (ret == -EPROBE_DEFER) - return ret; + if (gpio == -EPROBE_DEFER) + return gpio; - if (ret < 0) { + if (gpio < 0) { dev_err(chip->dev, "unable to get gpio %u\n", gpio_num); - return ret; + return gpio; } -- 2.19.0 _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox