mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v1] leds: lp5569: Use sysfs_emit instead of sprintf()
@ 2026-02-07 18:18 Neel Bullywon
  2026-03-05 17:31 ` (subset) " Lee Jones
  0 siblings, 1 reply; 2+ messages in thread
From: Neel Bullywon @ 2026-02-07 18:18 UTC (permalink / raw)
  To: lee, pavel; +Cc: linux-leds, linux-kernel, Neel Bullywon

Replace sprintf() with sysfs_emit(), which is the modern standard for
formatting sysfs output.

This change aligng with the kernel's best practices and ensures usage of
the most up to date API.

Signed-off-by: Neel Bullywon <neelb2403@gmail.com>
---
 drivers/leds/leds-lp5569.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/leds/leds-lp5569.c b/drivers/leds/leds-lp5569.c
index 786f2aa35319..a252ba6c455d 100644
--- a/drivers/leds/leds-lp5569.c
+++ b/drivers/leds/leds-lp5569.c
@@ -410,12 +410,12 @@ static ssize_t lp5569_selftest(struct device *dev,
 	/* Test LED Open */
 	pos = lp5569_led_open_test(led, buf);
 	if (pos < 0)
-		return sprintf(buf, "FAIL\n");
+		return sysfs_emit(buf, "FAIL\n");
 
 	/* Test LED Shorted */
 	pos += lp5569_led_short_test(led, buf);
 	if (pos < 0)
-		return sprintf(buf, "FAIL\n");
+		return sysfs_emit(buf, "FAIL\n");
 
 	for (i = 0; i < chip->pdata->num_channels; i++) {
 		/* Restore current */
-- 
2.44.0


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

* Re: (subset) [PATCH v1] leds: lp5569: Use sysfs_emit instead of sprintf()
  2026-02-07 18:18 [PATCH v1] leds: lp5569: Use sysfs_emit instead of sprintf() Neel Bullywon
@ 2026-03-05 17:31 ` Lee Jones
  0 siblings, 0 replies; 2+ messages in thread
From: Lee Jones @ 2026-03-05 17:31 UTC (permalink / raw)
  To: lee, pavel, Neel Bullywon; +Cc: linux-leds, linux-kernel

On Sat, 07 Feb 2026 13:18:25 -0500, Neel Bullywon wrote:
> Replace sprintf() with sysfs_emit(), which is the modern standard for
> formatting sysfs output.
> 
> This change aligng with the kernel's best practices and ensures usage of
> the most up to date API.
> 
> 
> [...]

Applied, thanks!

[1/1] leds: lp5569: Use sysfs_emit instead of sprintf()
      commit: 1db4b1d941f7453ba2922e32c0f2bd1216cb3ae6

--
Lee Jones [李琼斯]


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

end of thread, other threads:[~2026-03-05 17:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-07 18:18 [PATCH v1] leds: lp5569: Use sysfs_emit instead of sprintf() Neel Bullywon
2026-03-05 17:31 ` (subset) " Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®