Commit 7ae8d8ea authored by Takashi Iwai's avatar Takashi Iwai Committed by Mark Brown

ASoC: Intel: catpt: 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: default avatarTakashi Iwai <tiwai@suse.de>
Acked-by: default avatarCezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220801170108.26340-5-tiwai@suse.deSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 0aab7bda
......@@ -27,8 +27,8 @@ static ssize_t fw_version_show(struct device *dev,
if (ret)
return CATPT_IPC_ERROR(ret);
return sprintf(buf, "%d.%d.%d.%d\n", version.type, version.major,
version.minor, version.build);
return sysfs_emit(buf, "%d.%d.%d.%d\n", version.type, version.major,
version.minor, version.build);
}
static DEVICE_ATTR_RO(fw_version);
......@@ -37,7 +37,7 @@ static ssize_t fw_info_show(struct device *dev,
{
struct catpt_dev *cdev = dev_get_drvdata(dev);
return sprintf(buf, "%s\n", cdev->ipc.config.fw_info);
return sysfs_emit(buf, "%s\n", cdev->ipc.config.fw_info);
}
static DEVICE_ATTR_RO(fw_info);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment