mirror of
https://github.com/torvalds/linux.git
synced 2026-06-01 02:53:36 +02:00
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 <dan.carpenter@linaro.org> Closes: https://lore.kernel.org/all/aR1xbxEQyQPEvB9o@stanley.mountain/ Signed-off-by: Denis Benato <denis.benato@linux.dev> Link: https://patch.msgid.link/20251120024059.1341326-1-denis.benato@linux.dev Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
This commit is contained in:
parent
0a69fe8f09
commit
6b87f7ea74
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user