* [PATCH] leds: led-class: detect brightness conversion base from string
@ 2026-01-23 9:57 Michael Tretter
2026-02-05 15:48 ` (subset) " Lee Jones
2026-03-05 13:55 ` Andy Shevchenko
0 siblings, 2 replies; 7+ messages in thread
From: Michael Tretter @ 2026-01-23 9:57 UTC (permalink / raw)
To: Lee Jones, Pavel Machek
Cc: linux-leds, kernel, Thorsten Schmelzer, Michael Tretter
From: Thorsten Schmelzer <tschmelzer@topcon.com>
sysfs-class-led doesn't specify the number format for the brightness,
but the class only accepts base 10 numbers.
Use the automatic base detection of kstrtoul and accept the brightness
as hex value as well.
Signed-off-by: Thorsten Schmelzer <tschmelzer@topcon.com>
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
---
drivers/leds/led-class.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c
index d34a19453560..8993b78b4162 100644
--- a/drivers/leds/led-class.c
+++ b/drivers/leds/led-class.c
@@ -55,7 +55,7 @@ static ssize_t brightness_store(struct device *dev,
goto unlock;
}
- ret = kstrtoul(buf, 10, &state);
+ ret = kstrtoul(buf, 0, &state);
if (ret)
goto unlock;
---
base-commit: c072629f05d7bca1148ab17690d7922a31423984
change-id: 20260123-leds-class-convert-brightness-value-c46608002873
Best regards,
--
Michael Tretter <m.tretter@pengutronix.de>
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: (subset) [PATCH] leds: led-class: detect brightness conversion base from string
2026-01-23 9:57 [PATCH] leds: led-class: detect brightness conversion base from string Michael Tretter
@ 2026-02-05 15:48 ` Lee Jones
2026-03-05 13:55 ` Andy Shevchenko
1 sibling, 0 replies; 7+ messages in thread
From: Lee Jones @ 2026-02-05 15:48 UTC (permalink / raw)
To: Lee Jones, Pavel Machek, Michael Tretter
Cc: linux-leds, kernel, Thorsten Schmelzer
On Fri, 23 Jan 2026 10:57:26 +0100, Michael Tretter wrote:
> sysfs-class-led doesn't specify the number format for the brightness,
> but the class only accepts base 10 numbers.
>
> Use the automatic base detection of kstrtoul and accept the brightness
> as hex value as well.
>
>
> [...]
Applied, thanks!
[1/1] leds: led-class: detect brightness conversion base from string
commit: 07da045a49bd4cb17678d74efbdd600c71b136d4
--
Lee Jones [李琼斯]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] leds: led-class: detect brightness conversion base from string
2026-01-23 9:57 [PATCH] leds: led-class: detect brightness conversion base from string Michael Tretter
2026-02-05 15:48 ` (subset) " Lee Jones
@ 2026-03-05 13:55 ` Andy Shevchenko
2026-03-06 11:32 ` Lee Jones
1 sibling, 1 reply; 7+ messages in thread
From: Andy Shevchenko @ 2026-03-05 13:55 UTC (permalink / raw)
To: Michael Tretter
Cc: Lee Jones, Pavel Machek, linux-leds, kernel, Thorsten Schmelzer
On Fri, Jan 23, 2026 at 10:57:26AM +0100, Michael Tretter wrote:
> From: Thorsten Schmelzer <tschmelzer@topcon.com>
>
> sysfs-class-led doesn't specify the number format for the brightness,
> but the class only accepts base 10 numbers.
>
> Use the automatic base detection of kstrtoul and accept the brightness
> as hex value as well.
This obviously brings a regression.
Previously the 000000000000100 is 100, now it's 64.
While I don't care much (I even like the change), I have to point this out.
The correct fix is to update documentation.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] leds: led-class: detect brightness conversion base from string
2026-03-05 13:55 ` Andy Shevchenko
@ 2026-03-06 11:32 ` Lee Jones
2026-03-06 15:11 ` Andy Shevchenko
0 siblings, 1 reply; 7+ messages in thread
From: Lee Jones @ 2026-03-06 11:32 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Michael Tretter, Pavel Machek, linux-leds, kernel,
Thorsten Schmelzer
On Thu, 05 Mar 2026, Andy Shevchenko wrote:
> On Fri, Jan 23, 2026 at 10:57:26AM +0100, Michael Tretter wrote:
> > From: Thorsten Schmelzer <tschmelzer@topcon.com>
> >
> > sysfs-class-led doesn't specify the number format for the brightness,
> > but the class only accepts base 10 numbers.
> >
> > Use the automatic base detection of kstrtoul and accept the brightness
> > as hex value as well.
>
> This obviously brings a regression.
> Previously the 000000000000100 is 100, now it's 64.
>
> While I don't care much (I even like the change), I have to point this out.
>
> The correct fix is to update documentation.
Again, should we remove this patch that you like?
--
Lee Jones [李琼斯]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] leds: led-class: detect brightness conversion base from string
2026-03-06 11:32 ` Lee Jones
@ 2026-03-06 15:11 ` Andy Shevchenko
2026-03-10 9:23 ` Lee Jones
0 siblings, 1 reply; 7+ messages in thread
From: Andy Shevchenko @ 2026-03-06 15:11 UTC (permalink / raw)
To: Lee Jones
Cc: Michael Tretter, Pavel Machek, linux-leds, kernel,
Thorsten Schmelzer
On Fri, Mar 06, 2026 at 11:32:21AM +0000, Lee Jones wrote:
> On Thu, 05 Mar 2026, Andy Shevchenko wrote:
> > On Fri, Jan 23, 2026 at 10:57:26AM +0100, Michael Tretter wrote:
> > > From: Thorsten Schmelzer <tschmelzer@topcon.com>
> > >
> > > sysfs-class-led doesn't specify the number format for the brightness,
> > > but the class only accepts base 10 numbers.
> > >
> > > Use the automatic base detection of kstrtoul and accept the brightness
> > > as hex value as well.
> >
> > This obviously brings a regression.
> > Previously the 000000000000100 is 100, now it's 64.
> >
> > While I don't care much (I even like the change), I have to point this out.
> >
> > The correct fix is to update documentation.
>
> Again, should we remove this patch that you like?
Depends if anybody outside relies on the above mentioned decimal values
with leading 0(s). On the safest side is better to drop (and explain in
the documentation that the values are decimal).
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] leds: led-class: detect brightness conversion base from string
2026-03-06 15:11 ` Andy Shevchenko
@ 2026-03-10 9:23 ` Lee Jones
2026-03-10 16:52 ` Andy Shevchenko
0 siblings, 1 reply; 7+ messages in thread
From: Lee Jones @ 2026-03-10 9:23 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Michael Tretter, Pavel Machek, linux-leds, kernel,
Thorsten Schmelzer
On Fri, 06 Mar 2026, Andy Shevchenko wrote:
> On Fri, Mar 06, 2026 at 11:32:21AM +0000, Lee Jones wrote:
> > On Thu, 05 Mar 2026, Andy Shevchenko wrote:
> > > On Fri, Jan 23, 2026 at 10:57:26AM +0100, Michael Tretter wrote:
> > > > From: Thorsten Schmelzer <tschmelzer@topcon.com>
> > > >
> > > > sysfs-class-led doesn't specify the number format for the brightness,
> > > > but the class only accepts base 10 numbers.
> > > >
> > > > Use the automatic base detection of kstrtoul and accept the brightness
> > > > as hex value as well.
> > >
> > > This obviously brings a regression.
> > > Previously the 000000000000100 is 100, now it's 64.
> > >
> > > While I don't care much (I even like the change), I have to point this out.
> > >
> > > The correct fix is to update documentation.
> >
> > Again, should we remove this patch that you like?
>
> Depends if anybody outside relies on the above mentioned decimal values
> with leading 0(s). On the safest side is better to drop (and explain in
> the documentation that the values are decimal).
For the fear of breaking userspace, I have dropped the patch.
Please could someone update the docs?
--
Lee Jones [李琼斯]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] leds: led-class: detect brightness conversion base from string
2026-03-10 9:23 ` Lee Jones
@ 2026-03-10 16:52 ` Andy Shevchenko
0 siblings, 0 replies; 7+ messages in thread
From: Andy Shevchenko @ 2026-03-10 16:52 UTC (permalink / raw)
To: Lee Jones
Cc: Michael Tretter, Pavel Machek, linux-leds, kernel,
Thorsten Schmelzer
On Tue, Mar 10, 2026 at 09:23:19AM +0000, Lee Jones wrote:
> On Fri, 06 Mar 2026, Andy Shevchenko wrote:
> > On Fri, Mar 06, 2026 at 11:32:21AM +0000, Lee Jones wrote:
> > > On Thu, 05 Mar 2026, Andy Shevchenko wrote:
> > > > On Fri, Jan 23, 2026 at 10:57:26AM +0100, Michael Tretter wrote:
...
> > > > The correct fix is to update documentation.
> > >
> > > Again, should we remove this patch that you like?
> >
> > Depends if anybody outside relies on the above mentioned decimal values
> > with leading 0(s). On the safest side is better to drop (and explain in
> > the documentation that the values are decimal).
>
> For the fear of breaking userspace, I have dropped the patch.
>
> Please could someone update the docs?
Done in 20260310165143.354065-1-andriy.shevchenko@linux.intel.com.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-03-10 16:52 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-23 9:57 [PATCH] leds: led-class: detect brightness conversion base from string Michael Tretter
2026-02-05 15:48 ` (subset) " Lee Jones
2026-03-05 13:55 ` Andy Shevchenko
2026-03-06 11:32 ` Lee Jones
2026-03-06 15:11 ` Andy Shevchenko
2026-03-10 9:23 ` Lee Jones
2026-03-10 16:52 ` Andy Shevchenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox