Skip to content
Unverified Commit c82f27df authored by H. Nikolaus Schaller's avatar H. Nikolaus Schaller Committed by Mark Brown
Browse files

regulator: core: Fix error return for /sys access



regulator_uV_show() is missing error handling if regulator_get_voltage_rdev()
returns negative values. Instead it prints the errno as a string, e.g. -EINVAL
as "-22" which could be interpreted as -22 µV.

We also do not need to hold the lock while converting the integer to a string.

Reported-by: default avatarAdam Ford <aford173@gmail.com>
Signed-off-by: default avatarH. Nikolaus Schaller <hns@goldelico.com>
Tested-by: default avatarAdam Ford <aford173@gmail.com>
Link: https://lore.kernel.org/r/f37f2a1276efcb34cf3b7f1a25481175be048806.1568143348.git.hns@goldelico.com
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 5eda8e95
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment