Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 114275
b: refs/heads/master
c: e06f5b4
h: refs/heads/master
i:
  114273: 8cb4791
  114271: 8e20a59
v: v3
  • Loading branch information
Mark Brown authored and Liam Girdwood committed Oct 13, 2008
1 parent 9d6c134 commit e18a329
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 46fabe1edd44a8893d88d7982f88d01ccf77f0bb
refs/heads/master: e06f5b4fea243b152c79fe5d9552a852069de483
23 changes: 19 additions & 4 deletions trunk/drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,14 @@ static int set_machine_constraints(struct regulator_dev *rdev,
struct regulation_constraints *constraints)
{
int ret = 0;
const char *name;

if (constraints->name)
name = constraints->name;
else if (rdev->desc->name)
name = rdev->desc->name;
else
name = "regulator";

rdev->constraints = constraints;

Expand All @@ -679,9 +687,9 @@ static int set_machine_constraints(struct regulator_dev *rdev,
ret = rdev->desc->ops->set_voltage(rdev,
rdev->constraints->min_uV, rdev->constraints->max_uV);
if (ret < 0) {
printk(KERN_ERR "%s: failed to apply %duV"
" constraint\n", __func__,
rdev->constraints->min_uV);
printk(KERN_ERR "%s: failed to apply %duV constraint to %s\n",
__func__,
rdev->constraints->min_uV, name);
rdev->constraints = NULL;
goto out;
}
Expand All @@ -692,8 +700,15 @@ static int set_machine_constraints(struct regulator_dev *rdev,
rdev->use_count = 1;

/* do we need to setup our suspend state */
if (constraints->initial_state)
if (constraints->initial_state) {
ret = suspend_prepare(rdev, constraints->initial_state);
if (ret < 0) {
printk(KERN_ERR "%s: failed to set suspend state for %s\n",
__func__, name);
rdev->constraints = NULL;
goto out;
}
}

print_constraints(rdev);
out:
Expand Down

0 comments on commit e18a329

Please sign in to comment.