Skip to contentSkip to conversation

platform/x86: asus-armoury: fix mini-led mode show

PATCH In review Denis Benato 2 participants 3 messages Nov 20, 2025 – Nov 21, 2025

Subsystems (2)
lore
Share & tools
lore

Denis Benato

author maintainer
#0 lore raw

PATCH 1/1 platform/x86: asus-armoury: fix mini-led mode show

Perform the actual check of the mini-led mode against supported modes and do not return the first one regardless of the WMI devstate.

---
 drivers/platform/x86/asus-armoury.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/platform/x86/asus-armoury.c +2 -1
index d6aba68515e2..c4919f3bf4b2 100644
@@ -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;
Signature · 1 line
2.52.0
maintainer
#1 lore raw
Quoted 1 line · 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.

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).

Signature · 1 line
 i.
Quoted 23 lines
---
 drivers/platform/x86/asus-armoury.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/platform/x86/asus-armoury.c +2 -1
index d6aba68515e2..c4919f3bf4b2 100644
@@ -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;
author maintainer
#2 lore raw
Quoted 7 lines · Ilpo Järvinen
Quoted 1 line · 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.

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