fbdev: sm501fb: Convert sysfs snprintf to sysfs_emit
authorXuezhi Zhang <zhangxuezhi1@coolpad.com>
Tue, 18 Oct 2022 06:25:48 +0000 (14:25 +0800)
committerHelge Deller <deller@gmx.de>
Tue, 18 Oct 2022 08:22:28 +0000 (10:22 +0200)
Follow the advice of the Documentation/filesystems/sysfs.rst
and show() should only use sysfs_emit() or sysfs_emit_at()
when formatting the value to be returned to user space.

Signed-off-by: Xuezhi Zhang <zhangxuezhi1@coolpad.com>
Signed-off-by: Helge Deller <deller@gmx.de>
drivers/video/fbdev/sm501fb.c

index fce6cfbadfd60e30e7c28c4afe13267e866c116f..f743bfbde2a6cb02e98fde4bbee27ddb2cf7b452 100644 (file)
@@ -1166,7 +1166,7 @@ static ssize_t sm501fb_crtsrc_show(struct device *dev,
        ctrl = smc501_readl(info->regs + SM501_DC_CRT_CONTROL);
        ctrl &= SM501_DC_CRT_CONTROL_SEL;
 
-       return snprintf(buf, PAGE_SIZE, "%s\n", ctrl ? "crt" : "panel");
+       return sysfs_emit(buf, "%s\n", ctrl ? "crt" : "panel");
 }
 
 /* sm501fb_crtsrc_show