diff options
-rw-r--r-- | drivers/regulator/core.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index a12cba32460e..ab419f8b2a84 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c | |||
@@ -1697,10 +1697,17 @@ static int _regulator_do_set_voltage(struct regulator_dev *rdev, | |||
1697 | int regulator_set_voltage(struct regulator *regulator, int min_uV, int max_uV) | 1697 | int regulator_set_voltage(struct regulator *regulator, int min_uV, int max_uV) |
1698 | { | 1698 | { |
1699 | struct regulator_dev *rdev = regulator->rdev; | 1699 | struct regulator_dev *rdev = regulator->rdev; |
1700 | int ret; | 1700 | int ret = 0; |
1701 | 1701 | ||
1702 | mutex_lock(&rdev->mutex); | 1702 | mutex_lock(&rdev->mutex); |
1703 | 1703 | ||
1704 | /* If we're setting the same range as last time the change | ||
1705 | * should be a noop (some cpufreq implementations use the same | ||
1706 | * voltage for multiple frequencies, for example). | ||
1707 | */ | ||
1708 | if (regulator->min_uV == min_uV && regulator->max_uV == max_uV) | ||
1709 | goto out; | ||
1710 | |||
1704 | /* sanity check */ | 1711 | /* sanity check */ |
1705 | if (!rdev->desc->ops->set_voltage && | 1712 | if (!rdev->desc->ops->set_voltage && |
1706 | !rdev->desc->ops->set_voltage_sel) { | 1713 | !rdev->desc->ops->set_voltage_sel) { |