* [PATCH] leds: Don't emit brightness set error message if LED supports hw triggers only
@ 2021-07-22 20:25 Heiner Kallweit
2021-11-01 11:59 ` Pavel Machek
0 siblings, 1 reply; 4+ messages in thread
From: Heiner Kallweit @ 2021-07-22 20:25 UTC (permalink / raw)
To: Pavel Machek; +Cc: linux-leds@vger.kernel.org
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@gmail.com>
---
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] leds: Don't emit brightness set error message if LED supports hw triggers only
2021-07-22 20:25 [PATCH] leds: Don't emit brightness set error message if LED supports hw triggers only Heiner Kallweit
@ 2021-11-01 11:59 ` Pavel Machek
2021-11-01 12:47 ` Heiner Kallweit
2021-11-01 12:48 ` Marek Behún
0 siblings, 2 replies; 4+ messages in thread
From: Pavel Machek @ 2021-11-01 11:59 UTC (permalink / raw)
To: Heiner Kallweit; +Cc: linux-leds@vger.kernel.org
[-- Attachment #1: Type: text/plain, Size: 635 bytes --]
Hi!
> 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.
Hmm... do we have such LEDs in tree? LED supporting only hardware
triggers is kind of unusual/interesting/and I'm not really sure if we
should have them in LED subsystem.
Best regards,
Pavel
--
http://www.livejournal.com/~pavelmachek
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] leds: Don't emit brightness set error message if LED supports hw triggers only
2021-11-01 11:59 ` Pavel Machek
@ 2021-11-01 12:47 ` Heiner Kallweit
2021-11-01 12:48 ` Marek Behún
1 sibling, 0 replies; 4+ messages in thread
From: Heiner Kallweit @ 2021-11-01 12:47 UTC (permalink / raw)
To: Pavel Machek; +Cc: linux-leds@vger.kernel.org
On 01.11.2021 12:59, Pavel Machek wrote:
> Hi!
>
>
>> 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.
>
> Hmm... do we have such LEDs in tree? LED supporting only hardware
> triggers is kind of unusual/interesting/and I'm not really sure if we
> should have them in LED subsystem.
>
This was when working on network LED support for r8169 where you can
select between a number of HW triggers only. IIRC the discussion how
to support such network LEDs didn't really come to a conclusion yet.
Having said that at least my work hasn't been upstreamed yet.
> Best regards,
> Pavel
>
Heiner
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] leds: Don't emit brightness set error message if LED supports hw triggers only
2021-11-01 11:59 ` Pavel Machek
2021-11-01 12:47 ` Heiner Kallweit
@ 2021-11-01 12:48 ` Marek Behún
1 sibling, 0 replies; 4+ messages in thread
From: Marek Behún @ 2021-11-01 12:48 UTC (permalink / raw)
To: Pavel Machek; +Cc: Heiner Kallweit, linux-leds@vger.kernel.org
On Mon, 1 Nov 2021 12:59:10 +0100
Pavel Machek <pavel@ucw.cz> wrote:
> Hi!
>
>
> > 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.
>
> Hmm... do we have such LEDs in tree? LED supporting only hardware
> triggers is kind of unusual/interesting/and I'm not really sure if we
> should have them in LED subsystem.
Why not? I mean there actually are such LEDs and the LED subsystem is
the best fit for them. The LED trigger ABI can be used to set HW
control mode on these LEDs.
I think it would be confusing to put such LEDs into a different
subsystem.
Marek
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-11-01 12:48 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-22 20:25 [PATCH] leds: Don't emit brightness set error message if LED supports hw triggers only Heiner Kallweit
2021-11-01 11:59 ` Pavel Machek
2021-11-01 12:47 ` Heiner Kallweit
2021-11-01 12:48 ` Marek Behún
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).