public inbox for linux-leds@vger.kernel.org
 help / color / mirror / Atom feed
From: Neel Bullywon <neelb2403@gmail.com>
To: lee@kernel.org, pavel@kernel.org
Cc: linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org,
	Neel Bullywon <neelb2403@gmail.com>
Subject: [PATCH v1] leds: lp5569: Use sysfs_emit instead of sprintf()
Date: Sat,  7 Feb 2026 13:18:25 -0500	[thread overview]
Message-ID: <20260207181825.13481-1-neelb2403@gmail.com> (raw)

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


             reply	other threads:[~2026-02-07 18:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-07 18:18 Neel Bullywon [this message]
2026-03-05 17:31 ` (subset) [PATCH v1] leds: lp5569: Use sysfs_emit instead of sprintf() Lee Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260207181825.13481-1-neelb2403@gmail.com \
    --to=neelb2403@gmail.com \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox