From 83ca56b663cf3116c4a5535b4eb6eccb82113828 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Sat, 20 Mar 2021 08:14:02 +0100 Subject: iio: core: Use sysfs_emit() (trivial bits) 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. This patch converts the places in the iio core that follow the pattern of return s*printf(...) to return sysfs_emit(...) Signed-off-by: Lars-Peter Clausen Link: https://lore.kernel.org/r/20210320071405.9347-2-lars@metafoo.de Signed-off-by: Jonathan Cameron --- drivers/iio/industrialio-event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/iio/industrialio-event.c') diff --git a/drivers/iio/industrialio-event.c b/drivers/iio/industrialio-event.c index a30e289fc362..1b3a15bc75fe 100644 --- a/drivers/iio/industrialio-event.c +++ b/drivers/iio/industrialio-event.c @@ -297,7 +297,7 @@ static ssize_t iio_ev_state_show(struct device *dev, if (val < 0) return val; else - return sprintf(buf, "%d\n", val); + return sysfs_emit(buf, "%d\n", val); } static ssize_t iio_ev_value_show(struct device *dev, -- cgit