diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2021-03-20 08:14:05 +0100 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2021-03-29 12:12:30 +0200 |
commit | f46ac009780cb5ab2a0c85884fcc5f5bba7ee08e (patch) | |
tree | aa318bb7971859572d5fa56e682b151646d9ef58 /drivers/iio/dac/ad5770r.c | |
parent | iio: __iio_format_value(): Convert to sysfs_emit_at() (diff) | |
download | linux-f46ac009780cb5ab2a0c85884fcc5f5bba7ee08e.tar.xz linux-f46ac009780cb5ab2a0c85884fcc5f5bba7ee08e.zip |
iio: dac: Convert powerdown read callbacks to sysfs_emit()
Update DAC drivers powerdown attribute show callback to use the new
sysfs_emit() function.
sysfs_emit() is preferred over raw s*printf() for sysfs attributes since it
knows about the sysfs buffer specifics and has some built-in sanity checks.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20210320071405.9347-5-lars@metafoo.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/dac/ad5770r.c')
-rw-r--r-- | drivers/iio/dac/ad5770r.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/dac/ad5770r.c b/drivers/iio/dac/ad5770r.c index 4e7a8ed83cc1..7ab2ccf90863 100644 --- a/drivers/iio/dac/ad5770r.c +++ b/drivers/iio/dac/ad5770r.c @@ -433,7 +433,7 @@ static ssize_t ad5770r_read_dac_powerdown(struct iio_dev *indio_dev, { struct ad5770r_state *st = iio_priv(indio_dev); - return sprintf(buf, "%d\n", st->ch_pwr_down[chan->channel]); + return sysfs_emit(buf, "%d\n", st->ch_pwr_down[chan->channel]); } static ssize_t ad5770r_write_dac_powerdown(struct iio_dev *indio_dev, |