Skip to contentSkip to conversation

leds: lp5569: Use sysfs_emit instead of sprintf()

PATCH Applied Neel Bullywon 2 participants 2 messages Feb 7 – Mar 5 LED

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 leds: lp5569: Use sysfs_emit instead of sprintf()

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.

---
 drivers/leds/leds-lp5569.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/leds/leds-lp5569.c +2 -2
index 786f2aa35319..a252ba6c455d 100644
@@ -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 */
Signature · 1 line
2.44.0
maintainer Applied
#1 lore raw

Re: (subset) [PATCH v1] leds: lp5569: Use sysfs_emit instead of sprintf()

Quoted 8 lines · 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.

[...]

Applied, thanks!

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

      commit: 1db4b1d941f7453ba2922e32c0f2bd1216cb3ae6

--
Lee Jones [李琼斯]