summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Weißschuh <linux@weissschuh.net>2024-06-13 17:48:37 +0300
committerLee Jones <lee@kernel.org>2024-06-21 13:41:36 +0300
commit9cb6de2d2c5ca1a7478ee584954bb997fd9f7834 (patch)
tree1f4b60ca1fe86abca5a08f235e47b5c353724a82
parent5f2e950755c76c6fc20fc4ebd8355671fbbd7ac0 (diff)
downloadlinux-9cb6de2d2c5ca1a7478ee584954bb997fd9f7834.tar.xz
leds: multicolor: Use led_get_color_name() function
led_get_color_name() is a safer alternative to led_colors. led-class-multicolor.c is the only external user of led_colors and its removal allows unexporting the array. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://lore.kernel.org/r/20240613-cros_ec-led-v3-2-500b50f41e0f@weissschuh.net Signed-off-by: Lee Jones <lee@kernel.org>
-rw-r--r--drivers/leds/led-class-multicolor.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/leds/led-class-multicolor.c b/drivers/leds/led-class-multicolor.c
index ec62a4811613..584e3786a1e7 100644
--- a/drivers/leds/led-class-multicolor.c
+++ b/drivers/leds/led-class-multicolor.c
@@ -101,7 +101,7 @@ static ssize_t multi_index_show(struct device *dev,
for (i = 0; i < mcled_cdev->num_colors; i++) {
index = mcled_cdev->subled_info[i].color_index;
- len += sprintf(buf + len, "%s", led_colors[index]);
+ len += sprintf(buf + len, "%s", led_get_color_name(index));
if (i < mcled_cdev->num_colors - 1)
len += sprintf(buf + len, " ");
}