regulator: Fix return value of _set_load() stub
Mark Brown
maintainerPATCH 1/1 regulator: Fix return value of _set_load() stub
The stub implementation of _set_load() returns a mode value which is within the bounds of valid return codes for success (the documentation just says that failures are negative error codes) but not sensible or what the actual implementation does. Fix it to just return 0.
--- include/linux/regulator/consumer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/regulator/consumer.h +1 -1
@@ -508,7 +508,7 @@ static inline int regulator_get_error_flags(struct regulator *regulator,static inline int regulator_set_load (struct regulator *regulator,int load_uA) { -return REGULATOR_MODE_NORMAL ; +return 0 ; } static inline int regulator_allow_bypass(struct regulator *regulator,
Signature · 1 line
2.19.1
Hi,
Quoted 11 lines · Mark Brown
The stub implementation of
_set_load()returns a mode value which is within the bounds of valid return codes for success (the documentation just says that failures are negative error codes) but not sensible or what the actual implementation does. Fix it to just return 0.Reported-by Cheng-Yi Chiang <[email protected]>Signed-off-by Mark Brown <[email protected]>--- include/linux/regulator/consumer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
I had the same patch in my queue to send up. Note that the documentation of the function was changed in commit e39ce48f5362 ("regulator: Rename regulator_set_optimum_mode") though that patch didn't actually change the code in any significant way so presumably the bug is from even before that.