]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iio: adc: mcp3564: replace sprintf() with sysfs_emit()
authorNuno Sá <nuno.sa@analog.com>
Tue, 30 Sep 2025 15:33:12 +0000 (16:33 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 19 Oct 2025 10:59:17 +0000 (11:59 +0100)
Update the mcp3564_read_label() function to use sysfs_emit() for
generating labels.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Reviewed-by: Marius Cristea <marius.cristea@microchip.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/mcp3564.c

index cd679ff10a97c4be19ca461126bdfae2fa8431f2..fcdf13f49c48f31ba3a0a9079686d2b81a792744 100644 (file)
@@ -987,7 +987,7 @@ static int mcp3564_read_label(struct iio_dev *indio_dev,
 {
        struct mcp3564_state *adc = iio_priv(indio_dev);
 
-       return sprintf(label, "%s\n", adc->labels[chan->scan_index]);
+       return sysfs_emit(label, "%s\n", adc->labels[chan->scan_index]);
 }
 
 static int mcp3564_parse_fw_children(struct iio_dev *indio_dev)