openwrt/target/linux/generic/backport-6.1/815-v6.6-1-leds-turris-omnia-Use-sysfs_emit-instead-of-sprintf.patch
Marek Mojík 0be05de577
kernel: 6.1: Backport Turris Omnia LED patches
This backports patches
  leds: turris-omnia: Use sysfs_emit() instead of sprintf()
  leds: turris-omnia: Drop unnecessary mutex locking
  leds: turris-omnia: Do not use SMBUS calls
  leds: turris-omnia: Make set_brightness() more efficient
  leds: turris-omnia: Support HW controlled mode via private trigger
  leds: turris-omnia: Add support for enabling/disabling HW gamma correction
  leds: turris-omnia: Fix brightness setting and trigger activating
into backport-6.1.

The above patches replace:
  leds: turris-omnia: support HW controlled mode via private trigger
  leds: turris-omnia: initialize multi-intensity to full
  leds: turris-omnia: change max brightness from 255 to 1
from mvebu/patches-6.1.

Signed-off-by: Marek Mojík <marek.mojik@nic.cz>
2023-10-20 19:17:58 +02:00

30 lines
1.0 KiB
Diff

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