summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/cs43130.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2022-08-01 19:01:01 +0200
committerMark Brown <broonie@kernel.org>2022-08-15 01:19:44 +0100
commit32d3679cbb383478c7e9dff590f367f1d7dda975 (patch)
treea588b376f6592ded09ba38acd185875c7b2408b0 /sound/soc/codecs/cs43130.c
parent4d39265b930fb42eb396c3153a3f4afdee9f5c17 (diff)
ASoC: cs43130: Replace scnprintf() with sysfs_emit()
sysfs_emit() is a new helper to simplify the sysfs string output. Replace the open-code straightforwardly with this new helper. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20220801170108.26340-2-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/cs43130.c')
-rw-r--r--sound/soc/codecs/cs43130.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/sound/soc/codecs/cs43130.c b/sound/soc/codecs/cs43130.c
index ca4d47cc9c91..06c6ad3ca2b7 100644
--- a/sound/soc/codecs/cs43130.c
+++ b/sound/soc/codecs/cs43130.c
@@ -1666,10 +1666,9 @@ static int cs43130_show_dc(struct device *dev, char *buf, u8 ch)
struct cs43130_private *cs43130 = i2c_get_clientdata(client);
if (!cs43130->hpload_done)
- return scnprintf(buf, PAGE_SIZE, "NO_HPLOAD\n");
+ return sysfs_emit(buf, "NO_HPLOAD\n");
else
- return scnprintf(buf, PAGE_SIZE, "%u\n",
- cs43130->hpload_dc[ch]);
+ return sysfs_emit(buf, "%u\n", cs43130->hpload_dc[ch]);
}
static ssize_t hpload_dc_l_show(struct device *dev,
@@ -1705,8 +1704,8 @@ static int cs43130_show_ac(struct device *dev, char *buf, u8 ch)
if (cs43130->hpload_done && cs43130->ac_meas) {
for (i = 0; i < ARRAY_SIZE(cs43130_ac_freq); i++) {
- tmp = scnprintf(buf + j, PAGE_SIZE - j, "%u\n",
- cs43130->hpload_ac[i][ch]);
+ tmp = sysfs_emit_at(buf, j, "%u\n",
+ cs43130->hpload_ac[i][ch]);
if (!tmp)
break;
@@ -1715,7 +1714,7 @@ static int cs43130_show_ac(struct device *dev, char *buf, u8 ch)
return j;
} else {
- return scnprintf(buf, PAGE_SIZE, "NO_HPLOAD\n");
+ return sysfs_emit(buf, "NO_HPLOAD\n");
}
}