mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-03 07:16:42 +07:00
regulator: core: Add checking set_mode callback in regulator_set_optimum_mode
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>
This commit is contained in:
parent
8ac0e95d64
commit
854ccbaee7
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user