From: Jiri Slaby <jirislaby@kernel.org>
To: Hans de Goede <hdegoede@redhat.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Pavel Machek <pavel@ucw.cz>, Lee Jones <lee@kernel.org>,
linux-leds@vger.kernel.org, linux-serial@vger.kernel.org
Subject: Re: [PATCH] vt: keyboard: Use led_set_brightness() in LED trigger activate() callback
Date: Mon, 13 May 2024 07:09:55 +0200 [thread overview]
Message-ID: <3658e1d0-913c-4f31-aa92-06fbd8b717c1@kernel.org> (raw)
In-Reply-To: <20240511152030.4848-1-hdegoede@redhat.com>
On 11. 05. 24, 17:20, Hans de Goede wrote:
> A LED trigger's activate() callback gets called when the LED trigger
> gets activated for a specific LED, so that the trigger code can ensure
> the LED state matches the current state of the trigger condition.
>
> led_trigger_event() is intended for trigger condition state changes and
> iterates over _all_ LEDs which are controlled by this trigger changing
> the brightness of each of them.
>
> In the activate() case only the brightness of the LED which is being
> activated needs to change and that LED is passed as an argument to
> activate(), switch to led_set_brightness() to only change the brightness
> of the LED being activated.
LGTM, but could you elaborate on what behavior this fixes? Should it be
backported to stable?
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> drivers/tty/vt/keyboard.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/tty/vt/keyboard.c b/drivers/tty/vt/keyboard.c
> index a2116e135a82..804355da46f5 100644
> --- a/drivers/tty/vt/keyboard.c
> +++ b/drivers/tty/vt/keyboard.c
> @@ -1033,9 +1033,7 @@ static int kbd_led_trigger_activate(struct led_classdev *cdev)
>
> tasklet_disable(&keyboard_tasklet);
> if (ledstate != -1U)
> - led_trigger_event(&trigger->trigger,
> - ledstate & trigger->mask ?
> - LED_FULL : LED_OFF);
> + led_set_brightness(cdev, ledstate & trigger->mask ? LED_FULL : LED_OFF);
> tasklet_enable(&keyboard_tasklet);
>
> return 0;
thanks,
--
js
next prev parent reply other threads:[~2024-05-13 5:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-11 15:20 [PATCH] vt: keyboard: Use led_set_brightness() in LED trigger activate() callback Hans de Goede
2024-05-13 5:09 ` Jiri Slaby [this message]
2024-05-13 7:44 ` Hans de Goede
2024-05-15 6:32 ` Jiri Slaby
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3658e1d0-913c-4f31-aa92-06fbd8b717c1@kernel.org \
--to=jirislaby@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=hdegoede@redhat.com \
--cc=lee@kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=pavel@ucw.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).