* [PATCH] platform/x86: asus-armoury: fix mini-led mode show
@ 2025-11-20 2:40 Denis Benato
2025-11-21 15:28 ` Ilpo Järvinen
0 siblings, 1 reply; 3+ messages in thread
From: Denis Benato @ 2025-11-20 2:40 UTC (permalink / raw)
To: linux-kernel
Cc: platform-driver-x86, Hans de Goede, Ilpo Järvinen,
Limonciello, Mario, Luke D . Jones, Alok Tiwari, Derek John Clark,
Mateusz Schyboll, porfet828, Denis Benato, Dan Carpenter,
Denis Benato
Perform the actual check of the mini-led mode against supported modes and do not return the first one regardless of the WMI devstate.
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/all/aR1xbxEQyQPEvB9o@stanley.mountain/
Signed-off-by: Denis Benato <denis.benato@linux.dev>
---
drivers/platform/x86/asus-armoury.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/platform/x86/asus-armoury.c b/drivers/platform/x86/asus-armoury.c
index d6aba68515e2..c4919f3bf4b2 100644
--- a/drivers/platform/x86/asus-armoury.c
+++ b/drivers/platform/x86/asus-armoury.c
@@ -373,7 +373,8 @@ static ssize_t mini_led_mode_current_value_show(struct kobject *kobj,
mode = FIELD_GET(ASUS_MINI_LED_MODE_MASK, 0);
for (i = 0; i < mini_led_mode_map_size; i++)
- return sysfs_emit(buf, "%u\n", mini_led_mode_map[i]);
+ if (mode == mini_led_mode_map[i])
+ return sysfs_emit(buf, "%u\n", i);
pr_warn("Unrecognized mini-LED mode: %u", mode);
return -EINVAL;
--
2.52.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] platform/x86: asus-armoury: fix mini-led mode show
2025-11-20 2:40 [PATCH] platform/x86: asus-armoury: fix mini-led mode show Denis Benato
@ 2025-11-21 15:28 ` Ilpo Järvinen
2025-11-21 19:57 ` Denis Benato
0 siblings, 1 reply; 3+ messages in thread
From: Ilpo Järvinen @ 2025-11-21 15:28 UTC (permalink / raw)
To: Denis Benato
Cc: LKML, platform-driver-x86, Hans de Goede, Limonciello, Mario,
Luke D . Jones, Alok Tiwari, Derek John Clark, Mateusz Schyboll,
porfet828, Denis Benato, Dan Carpenter
On Thu, 20 Nov 2025, Denis Benato wrote:
> Perform the actual check of the mini-led mode against supported modes and do not return the first one regardless of the WMI devstate.
I've taken this patch but I had to reformat the changelog. Preferrably use
up to 72 character long lines in the changelog (though I might not nitpick
from anything up to 75).
--
i.
>
> Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> Closes: https://lore.kernel.org/all/aR1xbxEQyQPEvB9o@stanley.mountain/
> Signed-off-by: Denis Benato <denis.benato@linux.dev>
> ---
> drivers/platform/x86/asus-armoury.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/platform/x86/asus-armoury.c b/drivers/platform/x86/asus-armoury.c
> index d6aba68515e2..c4919f3bf4b2 100644
> --- a/drivers/platform/x86/asus-armoury.c
> +++ b/drivers/platform/x86/asus-armoury.c
> @@ -373,7 +373,8 @@ static ssize_t mini_led_mode_current_value_show(struct kobject *kobj,
> mode = FIELD_GET(ASUS_MINI_LED_MODE_MASK, 0);
>
> for (i = 0; i < mini_led_mode_map_size; i++)
> - return sysfs_emit(buf, "%u\n", mini_led_mode_map[i]);
> + if (mode == mini_led_mode_map[i])
> + return sysfs_emit(buf, "%u\n", i);
>
> pr_warn("Unrecognized mini-LED mode: %u", mode);
> return -EINVAL;
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] platform/x86: asus-armoury: fix mini-led mode show
2025-11-21 15:28 ` Ilpo Järvinen
@ 2025-11-21 19:57 ` Denis Benato
0 siblings, 0 replies; 3+ messages in thread
From: Denis Benato @ 2025-11-21 19:57 UTC (permalink / raw)
To: Ilpo Järvinen
Cc: LKML, platform-driver-x86, Hans de Goede, Limonciello, Mario,
Luke D . Jones, Alok Tiwari, Derek John Clark, Mateusz Schyboll,
porfet828, Denis Benato, Dan Carpenter
On 11/21/25 16:28, Ilpo Järvinen wrote:
> On Thu, 20 Nov 2025, Denis Benato wrote:
>
>> Perform the actual check of the mini-led mode against supported modes and do not return the first one regardless of the WMI devstate.
> I've taken this patch but I had to reformat the changelog. Preferrably use
> up to 72 character long lines in the changelog (though I might not nitpick
> from anything up to 75).
>
Thank you and sorry for the trouble, I'll try to keep that in mind and
commit from an editor that shows the border line :D
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-11-21 19:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-20 2:40 [PATCH] platform/x86: asus-armoury: fix mini-led mode show Denis Benato
2025-11-21 15:28 ` Ilpo Järvinen
2025-11-21 19:57 ` Denis Benato
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox