]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/leds/leds-gpio.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[karo-tx-linux.git] / drivers / leds / leds-gpio.c
index 7ea1ea42c2d2df4e67123fb8435ea5b5b10091bd..d26af0a79a90bf698fdc411302b465a0f87fd19c 100644 (file)
@@ -187,6 +187,7 @@ static struct gpio_leds_priv *gpio_leds_create(struct platform_device *pdev)
                led.gpiod = devm_get_gpiod_from_child(dev, child);
                if (IS_ERR(led.gpiod)) {
                        fwnode_handle_put(child);
+                       ret = PTR_ERR(led.gpiod);
                        goto err;
                }
 
@@ -229,7 +230,7 @@ static struct gpio_leds_priv *gpio_leds_create(struct platform_device *pdev)
 err:
        for (count = priv->num_leds - 2; count >= 0; count--)
                delete_gpio_led(&priv->leds[count]);
-       return ERR_PTR(-ENODEV);
+       return ERR_PTR(ret);
 }
 
 static const struct of_device_id of_gpio_leds_match[] = {