mirror of
https://github.com/torvalds/linux.git
synced 2026-01-25 15:03:52 +08:00
iio: adc: at91-sama5d2_adc: use sysfs_emit() to instead of scnprintf()
Replace the open-code with sysfs_emit() to simplify the code. Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn> Link: https://lore.kernel.org/r/202212011142333790361@zte.com.cn Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
committed by
Jonathan Cameron
parent
58c2630020
commit
7ae267954a
@@ -2181,7 +2181,7 @@ static ssize_t at91_adc_get_fifo_state(struct device *dev,
|
||||
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
|
||||
struct at91_adc_state *st = iio_priv(indio_dev);
|
||||
|
||||
return scnprintf(buf, PAGE_SIZE, "%d\n", !!st->dma_st.dma_chan);
|
||||
return sysfs_emit(buf, "%d\n", !!st->dma_st.dma_chan);
|
||||
}
|
||||
|
||||
static ssize_t at91_adc_get_watermark(struct device *dev,
|
||||
@@ -2190,7 +2190,7 @@ static ssize_t at91_adc_get_watermark(struct device *dev,
|
||||
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
|
||||
struct at91_adc_state *st = iio_priv(indio_dev);
|
||||
|
||||
return scnprintf(buf, PAGE_SIZE, "%d\n", st->dma_st.watermark);
|
||||
return sysfs_emit(buf, "%d\n", st->dma_st.watermark);
|
||||
}
|
||||
|
||||
static IIO_DEVICE_ATTR(hwfifo_enabled, 0444,
|
||||
|
||||
Reference in New Issue
Block a user