aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/leds
diff options
context:
space:
mode:
authorSoren Brinkmann <soren.brinkmann@xilinx.com>2015-01-31 22:15:00 -0500
committerBryan Wu <cooloney@gmail.com>2015-02-02 17:36:10 -0500
commitc6e71f813f7208d80bfe0f435d627fad1b204558 (patch)
tree8bacdd85fe59ad538cdd8058e470462acf35b67d /drivers/leds
parent4552d2ee3ccb50e2926c53f58c3d7c4c3df9568c (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>
Diffstat (limited to 'drivers/leds')
-rw-r--r--drivers/leds/leds-gpio.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c
index 7ea1ea42c2d2..d26af0a79a90 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)
187 led.gpiod = devm_get_gpiod_from_child(dev, child); 187 led.gpiod = devm_get_gpiod_from_child(dev, child);
188 if (IS_ERR(led.gpiod)) { 188 if (IS_ERR(led.gpiod)) {
189 fwnode_handle_put(child); 189 fwnode_handle_put(child);
190 ret = PTR_ERR(led.gpiod);
190 goto err; 191 goto err;
191 } 192 }
192 193
@@ -229,7 +230,7 @@ static struct gpio_leds_priv *gpio_leds_create(struct platform_device *pdev)
229err: 230err:
230 for (count = priv->num_leds - 2; count >= 0; count--) 231 for (count = priv->num_leds - 2; count >= 0; count--)
231 delete_gpio_led(&priv->leds[count]); 232 delete_gpio_led(&priv->leds[count]);
232 return ERR_PTR(-ENODEV); 233 return ERR_PTR(ret);
233} 234}
234 235
235static const struct of_device_id of_gpio_leds_match[] = { 236static const struct of_device_id of_gpio_leds_match[] = {