Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 198388
b: refs/heads/master
c: 500b4ac
h: refs/heads/master
v: v3
  • Loading branch information
Sundar R Iyer authored and Liam Girdwood committed May 25, 2010
1 parent 32457a8 commit f58fa79
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 64714354a45a58a072cfc926db0a078611a63d43
refs/heads/master: 500b4ac90d1103a7c302d5bb16c53f4ffc45d057
10 changes: 10 additions & 0 deletions trunk/drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1745,6 +1745,7 @@ int regulator_set_mode(struct regulator *regulator, unsigned int mode)
{
struct regulator_dev *rdev = regulator->rdev;
int ret;
int regulator_curr_mode;

mutex_lock(&rdev->mutex);

Expand All @@ -1754,6 +1755,15 @@ int regulator_set_mode(struct regulator *regulator, unsigned int mode)
goto out;
}

/* return if the same mode is requested */
if (rdev->desc->ops->get_mode) {
regulator_curr_mode = rdev->desc->ops->get_mode(rdev);
if (regulator_curr_mode == mode) {
ret = 0;
goto out;
}
}

/* constraints check */
ret = regulator_check_mode(rdev, mode);
if (ret < 0)
Expand Down

0 comments on commit f58fa79

Please sign in to comment.