gpiolib: Use sysfs_emit() in "show" functions
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 18 May 2021 12:09:17 +0000 (15:09 +0300)
committerBartosz Golaszewski <bgolaszewski@baylibre.com>
Fri, 21 May 2021 12:56:10 +0000 (14:56 +0200)
commit9e23bf6b00fd060d9a6fdf8a43f427d09992a21d
tree7805f9da3c1442cfedf525f3523e8b807d8bcbdb
parentfd80b8ba3aa5340a0bbfdc4b72bb6a2111cd54bf
gpiolib: Use sysfs_emit() in "show" functions

The sysfs_emit() function was introduced to make it less ambiguous
which function is preferred when writing to the output buffer in
a "show" callback [1].

Convert the GPIO library sysfs interface from sprintf() to sysfs_emit()
accordingly, as the latter is aware of the PAGE_SIZE buffer and correctly
returns the number of bytes written into the buffer.

No functional change intended.

[1] Documentation/filesystems/sysfs.rst

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
drivers/gpio/gpiolib-sysfs.c