Skip to content

Commit

Permalink
fbdev: sm501fb: Convert sysfs snprintf to sysfs_emit
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Xuezhi Zhang authored and Helge Deller committed Oct 18, 2022
1 parent 776d875 commit 9750737
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/video/fbdev/sm501fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9750737

Please sign in to comment.