diff options
author | Kim, Milo <Milo.Kim@ti.com> | 2012-08-22 15:32:29 +0800 |
---|---|---|
committer | Bryan Wu <bryan.wu@canonical.com> | 2012-09-11 18:32:41 +0800 |
commit | 94b43b677104e50b9f8dd75aacb3c69e16089a68 (patch) | |
tree | 991fa64dbabaa3eee5c0dd900a4bbe5ca0c0e3aa /drivers/leds | |
parent | 127aedc8ecae2628511533ddeb239e99e4bed5e8 (diff) |
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.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/leds/leds-lp5523.c b/drivers/leds/leds-lp5523.c index fbc12acada9..9fd9a92ed91 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) { |