summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorKim, Milo <Milo.Kim@ti.com>2012-03-23 23:02:08 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-24 00:58:34 +0100
commit5ae4e8a77dc82afcfe8460168ec0b94f4b79a54a (patch)
tree563eb3978832bff9e989b9cc7aa12b3da3f2fa20 /drivers
parentdrivers/leds/leds-tca6507.c: remove obsolete cleanup for clientdata (diff)
downloadlinux-5ae4e8a77dc82afcfe8460168ec0b94f4b79a54a.tar.xz
linux-5ae4e8a77dc82afcfe8460168ec0b94f4b79a54a.zip
drivers/leds/leds-lp5521.c: add 'name' in the lp5521_led_config
The name of each led channel can be configurable. For the compatibility, the name is set to default value(xx:channelN) when 'name' is not defined. Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Cc: Arun MURTHY <arun.murthy@stericsson.com> Cc: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> Cc: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/leds/leds-lp5521.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/leds/leds-lp5521.c b/drivers/leds/leds-lp5521.c
index c42c8f049565..59feecdfe3a8 100644
--- a/drivers/leds/leds-lp5521.c
+++ b/drivers/leds/leds-lp5521.c
@@ -620,10 +620,15 @@ static int __devinit lp5521_init_led(struct lp5521_led *led,
return -EINVAL;
}
- snprintf(name, sizeof(name), "%s:channel%d",
- pdata->label ?: client->name, chan);
led->cdev.brightness_set = lp5521_set_brightness;
- led->cdev.name = name;
+ if (pdata->led_config[chan].name) {
+ led->cdev.name = pdata->led_config[chan].name;
+ } else {
+ snprintf(name, sizeof(name), "%s:channel%d",
+ pdata->label ?: client->name, chan);
+ led->cdev.name = name;
+ }
+
res = led_classdev_register(dev, &led->cdev);
if (res < 0) {
dev_err(dev, "couldn't register led on channel %d\n", chan);