]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
staging: iio: ad9834: use sysfs_emit() and simplify show functions
authorGabriel Rondon <grondon@gmail.com>
Fri, 20 Mar 2026 22:24:24 +0000 (22:24 +0000)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 21 Mar 2026 13:16:07 +0000 (13:16 +0000)
commit8a75ac8f0a7274085aa71aacfaa21ed72bf8435b
treef5e00ba4bd20bf032b7838f932946e37e464cdc2
parentf6192780807d5c2fc08f506948b19c6072e1bfe8
staging: iio: ad9834: use sysfs_emit() and simplify show functions

Replace sprintf() with sysfs_emit() in sysfs attribute show functions.
sysfs_emit() is the preferred API for sysfs callbacks as it is aware
of the PAGE_SIZE buffer limit.

Also simplify the wavetype_available show functions by removing
the intermediate string variable and returning directly from each
branch.

Signed-off-by: Gabriel Rondon <grondon@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/staging/iio/frequency/ad9834.c