summaryrefslogtreecommitdiffstats
path: root/drivers/leds
diff options
context:
space:
mode:
authorKim, Milo <Milo.Kim@ti.com>2012-08-22 09:32:29 +0200
committerBryan Wu <bryan.wu@canonical.com>2012-09-11 12:32:41 +0200
commit94b43b677104e50b9f8dd75aacb3c69e16089a68 (patch)
tree991fa64dbabaa3eee5c0dd900a4bbe5ca0c0e3aa /drivers/leds
parentleds: leds-gpio: Use of_get_child_count() helper (diff)
downloadlinux-94b43b677104e50b9f8dd75aacb3c69e16089a68.tar.xz
linux-94b43b677104e50b9f8dd75aacb3c69e16089a68.zip
leds-lp5523: add channel name in the platform data
The name of each led channel is configurable. If the name is NULL, just use the channel id for making the channel name Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
Diffstat (limited to 'drivers/leds')
-rw-r--r--drivers/leds/leds-lp5523.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/leds/leds-lp5523.c b/drivers/leds/leds-lp5523.c
index fbc12acada95..9fd9a92ed916 100644
--- a/drivers/leds/leds-lp5523.c
+++ b/drivers/leds/leds-lp5523.c
@@ -846,10 +846,14 @@ static int __devinit lp5523_init_led(struct lp5523_led *led, struct device *dev,
return -EINVAL;
}
- snprintf(name, sizeof(name), "%s:channel%d",
- pdata->label ?: "lp5523", chan);
+ if (pdata->led_config[chan].name) {
+ led->cdev.name = pdata->led_config[chan].name;
+ } else {
+ snprintf(name, sizeof(name), "%s:channel%d",
+ pdata->label ?: "lp5523", chan);
+ led->cdev.name = name;
+ }
- led->cdev.name = name;
led->cdev.brightness_set = lp5523_set_brightness;
res = led_classdev_register(dev, &led->cdev);
if (res < 0) {