Re: [PATCH linux-next] backlight: lp8788: use sysfs_emit() to instead of scnprintf()

From
Han Jingoo <jingoohan1@gmail.com>
Date
2022-09-23 21:04:58
Also in
dri-devel, lkml
On Thu, Sep 22, 2022 [off-list ref] wrote:
From: ye xingchen <redacted>

Replace the open-code with sysfs_emit() to simplify the code.

Signed-off-by: ye xingchen <redacted>
Acked-by: Jingoo Han <jingoohan1@gmail.com>

Best regards,
Jingoo Han

quoted hunk
---
 drivers/video/backlight/lp8788_bl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/backlight/lp8788_bl.c b/drivers/video/backlight/lp8788_bl.c
index ba42f3fe0c73..00d79c0cfee9 100644
--- a/drivers/video/backlight/lp8788_bl.c
+++ b/drivers/video/backlight/lp8788_bl.c
@@ -240,7 +240,7 @@ static ssize_t lp8788_get_bl_ctl_mode(struct device *dev,
        else
                strmode = "Invalid mode";

-       return scnprintf(buf, PAGE_SIZE, "%s\n", strmode);
+       return sysfs_emit(buf, "%s\n", strmode);
 }

 static DEVICE_ATTR(bl_ctl_mode, S_IRUGO, lp8788_get_bl_ctl_mode, NULL);
--
2.25.1
Thread (1 message) 1 message, 1 author, last reply 2022-09-23
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help