aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/leds
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2023-11-03 21:53:09 +0200
committerLee Jones <lee@kernel.org>2023-12-13 11:28:38 +0000
commit7b9c5500f42e92992fe7b012974e0dddb673b1f5 (patch)
tree4f9b218858cd44dc2264eb07b3d5891773fa00ad /drivers/leds
parent7d6766f5377686b871ab52c564327718ece233ad (diff)
downloadlinux-7b9c5500f42e92992fe7b012974e0dddb673b1f5.tar.gz
leds: trigger: gpio: Use sysfs_emit() to instead of s*printf()
Follow the advice of the Documentation/filesystems/sysfs.rst and show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20231103195310.948327-3-andriy.shevchenko@linux.intel.com Signed-off-by: Lee Jones <lee@kernel.org>
Diffstat (limited to 'drivers/leds')
-rw-r--r--drivers/leds/trigger/ledtrig-gpio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/leds/trigger/ledtrig-gpio.c b/drivers/leds/trigger/ledtrig-gpio.c
index 8a30f92281869..8824be19881f1 100644
--- a/drivers/leds/trigger/ledtrig-gpio.c
+++ b/drivers/leds/trigger/ledtrig-gpio.c
@@ -46,7 +46,7 @@ static ssize_t gpio_trig_brightness_show(struct device *dev,
{
struct gpio_trig_data *gpio_data = led_trigger_get_drvdata(dev);
- return sprintf(buf, "%u\n", gpio_data->desired_brightness);
+ return sysfs_emit(buf, "%u\n", gpio_data->desired_brightness);
}
static ssize_t gpio_trig_brightness_store(struct device *dev,