未验证 提交 1218d67d 编写于 作者: T Takashi Iwai 提交者: Mark Brown

ASoC: tlv320aic26: Replace sprintf() with sysfs_emit()

For sysfs outputs, it's safer to use a new helper, sysfs_emit(),
instead of the raw sprintf() & co.  This patch replaces the sprintf()
usage straightforwardly with a new helper, sysfs_emit().
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20220801170108.26340-3-tiwai@suse.deSigned-off-by: NMark Brown <broonie@kernel.org>
上级 32d3679c
...@@ -271,7 +271,7 @@ static ssize_t keyclick_show(struct device *dev, ...@@ -271,7 +271,7 @@ static ssize_t keyclick_show(struct device *dev,
freq = (125 << ((val >> 8) & 0x7)) >> 1; freq = (125 << ((val >> 8) & 0x7)) >> 1;
len = 2 * (1 + ((val >> 4) & 0xf)); len = 2 * (1 + ((val >> 4) & 0xf));
return sprintf(buf, "amp=%x freq=%iHz len=%iclks\n", amp, freq, len); return sysfs_emit(buf, "amp=%x freq=%iHz len=%iclks\n", amp, freq, len);
} }
/* Any write to the keyclick attribute will trigger the keyclick event */ /* Any write to the keyclick attribute will trigger the keyclick event */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册