mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-27 11:06:41 -05:00
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>
This commit is contained in:
committed by
Jonathan Cameron
parent
08be56ebe9
commit
f24a5ef74c
@@ -1181,12 +1181,12 @@ static int read_label(struct iio_dev *indio_dev,
|
||||
char *label)
|
||||
{
|
||||
if (chan->type == IIO_TEMP)
|
||||
return sprintf(label, "temp-sensor\n");
|
||||
return sysfs_emit(label, "temp-sensor\n");
|
||||
if (chan->type == IIO_VOLTAGE && chan->channel >= NUM_MUX_0_VSS)
|
||||
return sprintf(label, "%s\n",
|
||||
return sysfs_emit(label, "%s\n",
|
||||
chan7_mux_names[chan->channel - NUM_MUX_0_VSS]);
|
||||
if (chan->type == IIO_VOLTAGE)
|
||||
return sprintf(label, "channel-%d\n", chan->channel);
|
||||
return sysfs_emit(label, "channel-%d\n", chan->channel);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user