lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231030054757.3476-1-jszhang@kernel.org>
Date:   Mon, 30 Oct 2023 13:47:57 +0800
From:   Jisheng Zhang <jszhang@...nel.org>
To:     Pavel Machek <pavel@....cz>, Lee Jones <lee@...nel.org>
Cc:     linux-leds@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] leds: Expand led_colors[] array

commit 472d7b9e8141 ("dt-bindings: leds: Expand LED_COLOR_ID
definitions") expands LED_COLOR_ID definitions for dt-binding. However,
it doesn't expand the led_colors[] array in leds core, so if any of
the newly expaned LED_COLOR_ID definitions is used, the sysfs will
emit null in the led's name color part. Let's expand the led_colors[]
array too.

Before the commit:
/sys/class/leds # ls
(null):indicator-0

After the commit:
/sys/class/leds # ls
orange:indicator-0

Signed-off-by: Jisheng Zhang <jszhang@...nel.org>
---
 drivers/leds/led-core.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/leds/led-core.c b/drivers/leds/led-core.c
index 04f9ea675f2c..742595d923ee 100644
--- a/drivers/leds/led-core.c
+++ b/drivers/leds/led-core.c
@@ -36,6 +36,11 @@ const char * const led_colors[LED_COLOR_ID_MAX] = {
 	[LED_COLOR_ID_IR] = "ir",
 	[LED_COLOR_ID_MULTI] = "multicolor",
 	[LED_COLOR_ID_RGB] = "rgb",
+	[LED_COLOR_ID_PURPLE] = "purple",
+	[LED_COLOR_ID_ORANGE] = "orange",
+	[LED_COLOR_ID_PINK] = "pink",
+	[LED_COLOR_ID_CYAN] = "cyan",
+	[LED_COLOR_ID_LIME] = "lime",
 };
 EXPORT_SYMBOL_GPL(led_colors);
 
-- 
2.40.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ