aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/leds/leds-lp5521.c3
-rw-r--r--include/linux/leds-lp5521.h1
2 files changed, 3 insertions, 1 deletions
diff --git a/drivers/leds/leds-lp5521.c b/drivers/leds/leds-lp5521.c
index 4d91c08656c5..80a3ae3c00b9 100644
--- a/drivers/leds/leds-lp5521.c
+++ b/drivers/leds/leds-lp5521.c
@@ -617,7 +617,8 @@ static int __init lp5521_init_led(struct lp5521_led *led,
617 return -EINVAL; 617 return -EINVAL;
618 } 618 }
619 619
620 snprintf(name, sizeof(name), "%s:channel%d", client->name, chan); 620 snprintf(name, sizeof(name), "%s:channel%d",
621 pdata->label ?: client->name, chan);
621 led->cdev.brightness_set = lp5521_set_brightness; 622 led->cdev.brightness_set = lp5521_set_brightness;
622 led->cdev.name = name; 623 led->cdev.name = name;
623 res = led_classdev_register(dev, &led->cdev); 624 res = led_classdev_register(dev, &led->cdev);
diff --git a/include/linux/leds-lp5521.h b/include/linux/leds-lp5521.h
index 38368d785f08..fd548d2a8775 100644
--- a/include/linux/leds-lp5521.h
+++ b/include/linux/leds-lp5521.h
@@ -42,6 +42,7 @@ struct lp5521_platform_data {
42 int (*setup_resources)(void); 42 int (*setup_resources)(void);
43 void (*release_resources)(void); 43 void (*release_resources)(void);
44 void (*enable)(bool state); 44 void (*enable)(bool state);
45 const char *label;
45}; 46};
46 47
47#endif /* __LINUX_LP5521_H */ 48#endif /* __LINUX_LP5521_H */