Commit c6e71f81 authored by Soren Brinkmann's avatar Soren Brinkmann Committed by Bryan Wu

leds: leds-gpio: Pass on error codes unmodified

Instead of overriding error codes, pass them on unmodified. This
way a EPROBE_DEFER is correctly passed to the driver core. This results
in the LED driver correctly requesting probe deferral in cases the GPIO
controller is not yet available.
Signed-off-by: default avatarSoren Brinkmann <soren.brinkmann@xilinx.com>
Reported-and-tested-by: default avatarAndreas Färber <afaerber@suse.de>
Signed-off-by: default avatarBryan Wu <cooloney@gmail.com>
parent 4552d2ee
...@@ -187,6 +187,7 @@ static struct gpio_leds_priv *gpio_leds_create(struct platform_device *pdev) ...@@ -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); led.gpiod = devm_get_gpiod_from_child(dev, child);
if (IS_ERR(led.gpiod)) { if (IS_ERR(led.gpiod)) {
fwnode_handle_put(child); fwnode_handle_put(child);
ret = PTR_ERR(led.gpiod);
goto err; goto err;
} }
...@@ -229,7 +230,7 @@ static struct gpio_leds_priv *gpio_leds_create(struct platform_device *pdev) ...@@ -229,7 +230,7 @@ static struct gpio_leds_priv *gpio_leds_create(struct platform_device *pdev)
err: err:
for (count = priv->num_leds - 2; count >= 0; count--) for (count = priv->num_leds - 2; count >= 0; count--)
delete_gpio_led(&priv->leds[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[] = { static const struct of_device_id of_gpio_leds_match[] = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment