diff options
Diffstat (limited to 'drivers/leds')
-rw-r--r-- | drivers/leds/leds-lp5521.c | 11 |
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, | |||
620 | return -EINVAL; | 620 | return -EINVAL; |
621 | } | 621 | } |
622 | 622 | ||
623 | snprintf(name, sizeof(name), "%s:channel%d", | ||
624 | pdata->label ?: client->name, chan); | ||
625 | led->cdev.brightness_set = lp5521_set_brightness; | 623 | led->cdev.brightness_set = lp5521_set_brightness; |
626 | led->cdev.name = name; | 624 | if (pdata->led_config[chan].name) { |
625 | led->cdev.name = pdata->led_config[chan].name; | ||
626 | } else { | ||
627 | snprintf(name, sizeof(name), "%s:channel%d", | ||
628 | pdata->label ?: client->name, chan); | ||
629 | led->cdev.name = name; | ||
630 | } | ||
631 | |||
627 | res = led_classdev_register(dev, &led->cdev); | 632 | res = led_classdev_register(dev, &led->cdev); |
628 | if (res < 0) { | 633 | if (res < 0) { |
629 | dev_err(dev, "couldn't register led on channel %d\n", chan); | 634 | dev_err(dev, "couldn't register led on channel %d\n", chan); |