diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 5c0c975e5ac2..2f0d557a910d 100644 --- 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) {