All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH linux-next] backlight: lp8788: use sysfs_emit() to instead of scnprintf()
@ 2022-09-23  6:35 cgel.zte
  2022-09-23 21:04   ` Han Jingoo
  2022-09-26 13:27   ` Daniel Thompson
  0 siblings, 2 replies; 7+ messages in thread
From: cgel.zte @ 2022-09-23  6:35 UTC (permalink / raw)
  To: lee
  Cc: daniel.thompson, jingoohan1, deller, linux-kernel, dri-devel,
	linux-fbdev, ye xingchen

From: ye xingchen <ye.xingchen@zte.com.cn>

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

Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
---
 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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-09-26 18:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-23  6:35 [PATCH linux-next] backlight: lp8788: use sysfs_emit() to instead of scnprintf() cgel.zte
2022-09-23 21:04 ` Han Jingoo
2022-09-23 21:04   ` Han Jingoo
2022-09-26 13:27 ` Daniel Thompson
2022-09-26 13:27   ` Daniel Thompson
2022-09-26 18:49   ` Han Jingoo
2022-09-26 18:49     ` Han Jingoo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.