Skip to content

Commit

Permalink
leds: leds-gpio: Pass on error codes unmodified
Browse files Browse the repository at this point in the history
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: Soren Brinkmann <[email protected]>
Reported-and-tested-by: Andreas Färber <[email protected]>
Signed-off-by: Bryan Wu <[email protected]>
  • Loading branch information
sorenb-xlnx authored and cooloney committed Feb 2, 2015
1 parent 4552d2e commit c6e71f8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/leds/leds-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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[] = {
Expand Down

0 comments on commit c6e71f8

Please sign in to comment.