From: Denis Benato Date: Thu, 20 Nov 2025 02:40:59 +0000 (+0100) Subject: platform/x86: asus-armoury: fix mini-led mode show X-Git-Tag: v6.19-rc1~42^2~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6b87f7ea741794d26d22ac40242ea5e1c57da7c9;p=thirdparty%2Flinux.git 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. Reported-by: Dan Carpenter Closes: https://lore.kernel.org/all/aR1xbxEQyQPEvB9o@stanley.mountain/ Signed-off-by: Denis Benato Link: https://patch.msgid.link/20251120024059.1341326-1-denis.benato@linux.dev Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen --- diff --git a/drivers/platform/x86/asus-armoury.c b/drivers/platform/x86/asus-armoury.c index c23b711043e2b..5106e8a41e25e 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;