Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio: adc: meson_saradc: replace sprintf() with sysfs_emit()

Update the read_label() function to use sysfs_emit() for generating
labels.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Nuno Sá and committed by
Jonathan Cameron
f24a5ef7 08be56eb

+3 -3
+3 -3
drivers/iio/adc/meson_saradc.c
··· 1181 1181 char *label) 1182 1182 { 1183 1183 if (chan->type == IIO_TEMP) 1184 - return sprintf(label, "temp-sensor\n"); 1184 + return sysfs_emit(label, "temp-sensor\n"); 1185 1185 if (chan->type == IIO_VOLTAGE && chan->channel >= NUM_MUX_0_VSS) 1186 - return sprintf(label, "%s\n", 1186 + return sysfs_emit(label, "%s\n", 1187 1187 chan7_mux_names[chan->channel - NUM_MUX_0_VSS]); 1188 1188 if (chan->type == IIO_VOLTAGE) 1189 - return sprintf(label, "channel-%d\n", chan->channel); 1189 + return sysfs_emit(label, "channel-%d\n", chan->channel); 1190 1190 return 0; 1191 1191 } 1192 1192