Skip to content

Commit a39bc7c

Browse files
ye xingchenbroonie
authored andcommitted
ASoC: imx-audmux: use sysfs_emit() to instead of scnprintf()
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: ye xingchen <ye.xingchen@zte.com.cn> Link: https://lore.kernel.org/r/202212051943476482106@zte.com.cn Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent ef0a098 commit a39bc7c

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

sound/soc/fsl/imx-audmux.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ static ssize_t audmux_read_file(struct file *file, char __user *user_buf,
7575
if (!buf)
7676
return -ENOMEM;
7777

78-
ret = scnprintf(buf, PAGE_SIZE, "PDCR: %08x\nPTCR: %08x\n",
79-
pdcr, ptcr);
78+
ret = sysfs_emit(buf, "PDCR: %08x\nPTCR: %08x\n", pdcr, ptcr);
8079

8180
if (ptcr & IMX_AUDMUX_V2_PTCR_TFSDIR)
8281
ret += scnprintf(buf + ret, PAGE_SIZE - ret,

0 commit comments

Comments
 (0)