projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8ac0e95
)
regulator: core: Add checking set_mode callback in regulator_set_optimum_mode
author
Axel Lin
<axel.lin@gmail.com>
Mon, 16 Apr 2012 10:44:23 +0000
(18:44 +0800)
committer
Mark Brown
<broonie@opensource.wolfsonmicro.com>
Mon, 16 Apr 2012 18:55:08 +0000
(19:55 +0100)
regulator_set_optimum_mode needs set_mode to properly work.
Add checking for set_mode callback in case it may be not implemented.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/regulator/core.c
patch
|
blob
|
history
diff --git
a/drivers/regulator/core.c
b/drivers/regulator/core.c
index 5c0c975e5ac2f5a0bb177abca8e39b4d06195130..2f0d557a910d4bdf92d687c074c23345633727ee 100644
(file)
--- a/
drivers/regulator/core.c
+++ b/
drivers/regulator/core.c
@@
-2335,6
+2335,9
@@
int regulator_set_optimum_mode(struct regulator *regulator, int uA_load)
*/
ret = -EINVAL;
+ if (!rdev->desc->ops->set_mode)
+ goto out;
+
/* get output voltage */
output_uV = _regulator_get_voltage(rdev);
if (output_uV <= 0) {