From: Thomas Weißschuh Date: Thu, 13 Jun 2024 14:48:37 +0000 (+0200) Subject: leds: multicolor: Use led_get_color_name() function X-Git-Tag: v6.11-rc1~147^2~54 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9cb6de2d2c5ca1a7478ee584954bb997fd9f7834;p=thirdparty%2Fkernel%2Flinux.git 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 Link: https://lore.kernel.org/r/20240613-cros_ec-led-v3-2-500b50f41e0f@weissschuh.net Signed-off-by: Lee Jones --- diff --git a/drivers/leds/led-class-multicolor.c b/drivers/leds/led-class-multicolor.c index ec62a48116135..584e3786a1e78 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, " "); }