sysfs: fix sysfs_set_policy()

Fix a bug that causes a failure when trying to write a new cpufreq
policy whose maximum frequency value is less than the old policy's
minimum frequency value. Since the max value is not allowed to be
lower than the min value, writing to the sysfs file scaling_max_freq
will fail. The patch checks for this situation, and if it occurs, will
write the new min value before writing the new max value.

Signed-off-by: Joseph Xu <>
Signed-off-by: Dominik Brodowski <>
1 file changed
tree: f8fb521d04138a4ff3b3221822e2a88219b45dca
  1. build/
  2. debug/
  3. lib/
  4. man/
  5. po/
  6. utils/
  7. .gitignore
  10. Makefile
  11. README