mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-11 01:53:20 -04:00
cpupower: Add support for parsing 'enabled' or 'disabled' strings from table
When cpufreq_get_sysfs_value_from_table() is passed a table with kernel strings that report 'enabled' or 'disabled' it always returns 0 because these can't cleanly convert to integers. Explicitly look for enabled or disabled strings from the kernel to handle this. Link: https://lore.kernel.org/r/20241218191144.3440854-3-superm1@kernel.org Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
This commit is contained in:
committed by
Shuah Khan
parent
dec2f97a15
commit
3f2eb7606e
@@ -102,6 +102,10 @@ unsigned long cpufreq_get_sysfs_value_from_table(unsigned int cpu,
|
||||
if (len == 0)
|
||||
return 0;
|
||||
|
||||
if (!strcmp(linebuf, "enabled\n"))
|
||||
return 1;
|
||||
if (!strcmp(linebuf, "disabled\n"))
|
||||
return 0;
|
||||
value = strtoul(linebuf, &endp, 0);
|
||||
|
||||
if (endp == linebuf || errno == ERANGE)
|
||||
|
||||
Reference in New Issue
Block a user