linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] leds: Expand led_colors[] array
@ 2023-10-30  5:47 Jisheng Zhang
  2023-11-23 10:56 ` Lee Jones
  0 siblings, 1 reply; 4+ messages in thread
From: Jisheng Zhang @ 2023-10-30  5:47 UTC (permalink / raw)
  To: Pavel Machek, Lee Jones; +Cc: linux-leds, linux-kernel

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@kernel.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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] leds: Expand led_colors[] array
  2023-10-30  5:47 [PATCH] leds: Expand led_colors[] array Jisheng Zhang
@ 2023-11-23 10:56 ` Lee Jones
  2023-11-27 15:59   ` Jisheng Zhang
  0 siblings, 1 reply; 4+ messages in thread
From: Lee Jones @ 2023-11-23 10:56 UTC (permalink / raw)
  To: Jisheng Zhang; +Cc: Pavel Machek, linux-leds, linux-kernel

On Mon, 30 Oct 2023, Jisheng Zhang wrote:

> 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@kernel.org>
> ---
>  drivers/leds/led-core.c | 5 +++++
>  1 file changed, 5 insertions(+)

This already exists as:

  a067943129b4e leds: core: Add more colors from DT bindings to led_colors

-- 
Lee Jones [李琼斯]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] leds: Expand led_colors[] array
  2023-11-23 10:56 ` Lee Jones
@ 2023-11-27 15:59   ` Jisheng Zhang
  2023-11-30 11:32     ` Lee Jones
  0 siblings, 1 reply; 4+ messages in thread
From: Jisheng Zhang @ 2023-11-27 15:59 UTC (permalink / raw)
  To: Lee Jones; +Cc: Pavel Machek, linux-leds, linux-kernel

On Thu, Nov 23, 2023 at 10:56:20AM +0000, Lee Jones wrote:
> On Mon, 30 Oct 2023, Jisheng Zhang wrote:
> 
> > 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@kernel.org>
> > ---
> >  drivers/leds/led-core.c | 5 +++++
> >  1 file changed, 5 insertions(+)
> 
> This already exists as:
> 
>   a067943129b4e leds: core: Add more colors from DT bindings to led_colors

well, my patch was sent earlier than this one... When I sent out the
patch there's neither fix in mailist nor in your repo.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] leds: Expand led_colors[] array
  2023-11-27 15:59   ` Jisheng Zhang
@ 2023-11-30 11:32     ` Lee Jones
  0 siblings, 0 replies; 4+ messages in thread
From: Lee Jones @ 2023-11-30 11:32 UTC (permalink / raw)
  To: Jisheng Zhang; +Cc: Pavel Machek, linux-leds, linux-kernel

On Mon, 27 Nov 2023, Jisheng Zhang wrote:

> On Thu, Nov 23, 2023 at 10:56:20AM +0000, Lee Jones wrote:
> > On Mon, 30 Oct 2023, Jisheng Zhang wrote:
> > 
> > > 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@kernel.org>
> > > ---
> > >  drivers/leds/led-core.c | 5 +++++
> > >  1 file changed, 5 insertions(+)
> > 
> > This already exists as:
> > 
> >   a067943129b4e leds: core: Add more colors from DT bindings to led_colors
> 
> well, my patch was sent earlier than this one... When I sent out the
> patch there's neither fix in mailist nor in your repo.

What makes you think that?

The applied patch was submitted 8th October.

https://lore.kernel.org/all/20231008144014.1180334-1-megi@xff.cz/

Yours was submitted 30th October, 3 weeks later.

https://lore.kernel.org/all/20231030054757.3476-1-jszhang@kernel.org/

-- 
Lee Jones [李琼斯]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-11-30 11:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-30  5:47 [PATCH] leds: Expand led_colors[] array Jisheng Zhang
2023-11-23 10:56 ` Lee Jones
2023-11-27 15:59   ` Jisheng Zhang
2023-11-30 11:32     ` Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).