diff mbox series

[6/8] ASoC: core: Replace sprintf() with sysfs_emit()

Message ID 20220801170108.26340-7-tiwai@suse.de
State Accepted
Commit 628d0f72d5828611cae353bd8b49d7647711c283
Headers show
Series ASoC: Replace sprintf() with sysfs_emit() | expand

Commit Message

Takashi Iwai Aug. 1, 2022, 5:01 p.m. UTC
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: Takashi Iwai <tiwai@suse.de>
---
 sound/soc/soc-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index e824ff1a9fc0..e020ab49cfb1 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -72,7 +72,7 @@  static ssize_t pmdown_time_show(struct device *dev,
 {
 	struct snd_soc_pcm_runtime *rtd = dev_get_drvdata(dev);
 
-	return sprintf(buf, "%ld\n", rtd->pmdown_time);
+	return sysfs_emit(buf, "%ld\n", rtd->pmdown_time);
 }
 
 static ssize_t pmdown_time_store(struct device *dev,