]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
leds: lp5569: Use sysfs_emit instead of sprintf()
authorNeel Bullywon <neelb2403@gmail.com>
Sat, 7 Feb 2026 18:18:25 +0000 (13:18 -0500)
committerLee Jones <lee@kernel.org>
Tue, 10 Mar 2026 09:22:55 +0000 (09:22 +0000)
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>
drivers/leds/leds-lp5569.c

index 786f2aa35319e3de3232a94ea4857ab0bd15e77a..a252ba6c455d577d9ef3e29db1ca2469d17efb85 100644 (file)
@@ -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 */