Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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.

Signed-off-by: Neel Bullywon <neelb2403@gmail.com>
Link: https://patch.msgid.link/20260207181825.13481-1-neelb2403@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Neel Bullywon and committed by
Lee Jones
0600cf91 b5227947

+2 -2
+2 -2
drivers/leds/leds-lp5569.c
··· 410 410 /* Test LED Open */ 411 411 pos = lp5569_led_open_test(led, buf); 412 412 if (pos < 0) 413 - return sprintf(buf, "FAIL\n"); 413 + return sysfs_emit(buf, "FAIL\n"); 414 414 415 415 /* Test LED Shorted */ 416 416 pos += lp5569_led_short_test(led, buf); 417 417 if (pos < 0) 418 - return sprintf(buf, "FAIL\n"); 418 + return sysfs_emit(buf, "FAIL\n"); 419 419 420 420 for (i = 0; i < chip->pdata->num_channels; i++) { 421 421 /* Restore current */