aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2022-08-01 19:01:03 +0200
committerMark Brown <broonie@kernel.org>2022-08-15 01:19:46 +0100
commit0aab7bda03086061abd5f8a7794324bb70f769a3 (patch)
tree40005427bbb44813c1257335705ec50aead773c4
parentASoC: tlv320aic26: Replace sprintf() with sysfs_emit() (diff)
downloadlinux-dev-0aab7bda03086061abd5f8a7794324bb70f769a3.tar.xz
linux-dev-0aab7bda03086061abd5f8a7794324bb70f769a3.zip
ASoC: Intel: sst: 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 those usages straightforwardly with a new helper, sysfs_emit(). Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20220801170108.26340-4-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/intel/atom/sst/sst.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sound/soc/intel/atom/sst/sst.c b/sound/soc/intel/atom/sst/sst.c
index 160b50f479fb..a0d29510d2bc 100644
--- a/sound/soc/intel/atom/sst/sst.c
+++ b/sound/soc/intel/atom/sst/sst.c
@@ -242,11 +242,11 @@ static ssize_t firmware_version_show(struct device *dev,
if (ctx->fw_version.type == 0 && ctx->fw_version.major == 0 &&
ctx->fw_version.minor == 0 && ctx->fw_version.build == 0)
- return sprintf(buf, "FW not yet loaded\n");
+ return sysfs_emit(buf, "FW not yet loaded\n");
else
- return sprintf(buf, "v%02x.%02x.%02x.%02x\n",
- ctx->fw_version.type, ctx->fw_version.major,
- ctx->fw_version.minor, ctx->fw_version.build);
+ return sysfs_emit(buf, "v%02x.%02x.%02x.%02x\n",
+ ctx->fw_version.type, ctx->fw_version.major,
+ ctx->fw_version.minor, ctx->fw_version.build);
}