summaryrefslogtreecommitdiff
path: root/drivers/iio/dac/ad5360.c
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2021-03-20 10:14:05 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2021-03-29 13:12:30 +0300
commitf46ac009780cb5ab2a0c85884fcc5f5bba7ee08e (patch)
treeaa318bb7971859572d5fa56e682b151646d9ef58 /drivers/iio/dac/ad5360.c
parent6b92ba0a3057787b52555cd81a661e9499f644f3 (diff)
downloadlinux-f46ac009780cb5ab2a0c85884fcc5f5bba7ee08e.tar.xz
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/ad5360.c')
-rw-r--r--drivers/iio/dac/ad5360.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/dac/ad5360.c b/drivers/iio/dac/ad5360.c
index 602dd2ba61b5..2d3b14c407d8 100644
--- a/drivers/iio/dac/ad5360.c
+++ b/drivers/iio/dac/ad5360.c
@@ -255,7 +255,7 @@ static ssize_t ad5360_read_dac_powerdown(struct device *dev,
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct ad5360_state *st = iio_priv(indio_dev);
- return sprintf(buf, "%d\n", (bool)(st->ctrl & AD5360_SF_CTRL_PWR_DOWN));
+ return sysfs_emit(buf, "%d\n", (bool)(st->ctrl & AD5360_SF_CTRL_PWR_DOWN));
}
static int ad5360_update_ctrl(struct iio_dev *indio_dev, unsigned int set,