Working on a driver for specific network LEDs that support HW triggers only I got error "Setting an LED's brightness failed" when switching to a different trigger. This is caused by call led_set_brightness(led_cdev, LED_OFF) in led_trigger_set() because both brigthness_set callbacks are not implemented. Let's suppress the error message in that case. Signed-off-by: Heiner Kallweit <hkallweit1@xxxxxxxxx> --- drivers/leds/led-core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/leds/led-core.c b/drivers/leds/led-core.c index 8eb8054ef..1104a7f0a 100644 --- a/drivers/leds/led-core.c +++ b/drivers/leds/led-core.c @@ -130,6 +130,8 @@ static void set_brightness_delayed(struct work_struct *ws) ret = __led_set_brightness_blocking(led_cdev, led_cdev->delayed_set_value); if (ret < 0 && + /* LED supports hw triggers only, therefore don't warn */ + ret != -ENOTSUPP && /* LED HW might have been unplugged, therefore don't warn */ !(ret == -ENODEV && (led_cdev->flags & LED_UNREGISTERING) && (led_cdev->flags & LED_HW_PLUGGABLE))) -- 2.32.0