diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2014-08-07 06:15:23 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2014-08-07 13:13:31 +0200 |
commit | 38c3b2455edea648f38d3e11baf478488fd698ed (patch) | |
tree | a66280a235dfd3fdb5c0411f4efc64b2b98aec0c /drivers/led | |
parent | 5b7b7ee5d943c6b58d9b7f974167d0105ca1b787 (diff) | |
parent | ca22ccd7cdbb6b2bd720dd7e14280ee1efa29074 (diff) | |
download | barebox-38c3b2455edea648f38d3e11baf478488fd698ed.tar.gz barebox-38c3b2455edea648f38d3e11baf478488fd698ed.tar.xz |
Merge branch 'for-next/misc'
Conflicts:
lib/Makefile
Diffstat (limited to 'drivers/led')
-rw-r--r-- | drivers/led/led-gpio.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/led/led-gpio.c b/drivers/led/led-gpio.c index 7bb3b49953..a1a661724d 100644 --- a/drivers/led/led-gpio.c +++ b/drivers/led/led-gpio.c @@ -206,13 +206,17 @@ static int led_gpio_of_probe(struct device_d *dev) struct gpio_led *gled; enum of_gpio_flags flags; int gpio; + const char *label; gpio = of_get_named_gpio_flags(child, "gpios", 0, &flags); if (gpio < 0) continue; gled = xzalloc(sizeof(*gled)); - gled->led.name = xstrdup(child->name); + if (of_property_read_string(child, "label", &label)) + label = child->name; + gled->led.name = xstrdup(label); + gled->gpio = gpio; gled->active_low = (flags & OF_GPIO_ACTIVE_LOW) ? 1 : 0; |