815-v6.6-1-leds-turris-omnia-Use-sysfs_emit-instead-of-sprintf.patch 1.0 KB

1234567891011121314151617181920212223242526272829
  1. From a75b58a46423cfd9b1f73581f4bd2ac2ae743996 Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Marek=20Beh=C3=BAn?= <[email protected]>
  3. Date: Wed, 2 Aug 2023 18:07:45 +0200
  4. Subject: [PATCH 1/6] leds: turris-omnia: Use sysfs_emit() instead of sprintf()
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. Use the dedicated sysfs_emit() function instead of sprintf() in sysfs
  9. attribute accessor brightness_show().
  10. Signed-off-by: Marek Behún <[email protected]>
  11. Link: https://lore.kernel.org/r/[email protected]
  12. Signed-off-by: Lee Jones <[email protected]>
  13. ---
  14. drivers/leds/leds-turris-omnia.c | 2 +-
  15. 1 file changed, 1 insertion(+), 1 deletion(-)
  16. --- a/drivers/leds/leds-turris-omnia.c
  17. +++ b/drivers/leds/leds-turris-omnia.c
  18. @@ -194,7 +194,7 @@ static ssize_t brightness_show(struct de
  19. if (ret < 0)
  20. return ret;
  21. - return sprintf(buf, "%d\n", ret);
  22. + return sysfs_emit(buf, "%d\n", ret);
  23. }
  24. static ssize_t brightness_store(struct device *dev, struct device_attribute *a,