diff options
author | Soren Brinkmann <soren.brinkmann@xilinx.com> | 2015-01-31 19:15:00 -0800 |
---|---|---|
committer | Max Krummenacher <max.krummenacher@toradex.com> | 2015-12-26 14:44:22 +0100 |
commit | 61aa28696d70f27987415b952359e768770d833b (patch) | |
tree | cb464e988460867f68bbb63f24e1aabfe84e7d0c /drivers | |
parent | 6b11748055b24d3b2a0c41a59168d8528a13b9bd (diff) |
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: Soren Brinkmann <soren.brinkmann@xilinx.com>
Reported-and-tested-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Bryan Wu <cooloney@gmail.com>
(cherry picked from commit c6e71f813f7208d80bfe0f435d627fad1b204558)
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/leds/leds-gpio.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c index 99474ed32dda..b833afba4001 100644 --- a/drivers/leds/leds-gpio.c +++ b/drivers/leds/leds-gpio.c @@ -187,6 +187,7 @@ static struct gpio_leds_priv *gpio_leds_create(struct platform_device *pdev) led.gpiod = devm_get_gpiod_from_child(dev, NULL, 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[] = { |