public inbox for linux-leds@vger.kernel.org
 help / color / mirror / Atom feed
* [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

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