Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 262156
b: refs/heads/master
c: 1a6958e
h: refs/heads/master
v: v3
  • Loading branch information
Axel Lin authored and Liam Girdwood committed Jul 22, 2011
1 parent 61daf58 commit e732a25
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 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: 89f425ed5bf3d4fd97e840296dccd75b8e0fe4c9
refs/heads/master: 1a6958e79f9e191c89fe0c13f7452b0bd8097050
7 changes: 4 additions & 3 deletions trunk/drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,6 @@ static int machine_constraints_voltage(struct regulator_dev *rdev,
if (ret < 0) {
rdev_err(rdev, "failed to apply %duV constraint\n",
rdev->constraints->min_uV);
rdev->constraints = NULL;
return ret;
}
}
Expand Down Expand Up @@ -897,7 +896,6 @@ static int set_machine_constraints(struct regulator_dev *rdev,
ret = suspend_prepare(rdev, rdev->constraints->initial_state);
if (ret < 0) {
rdev_err(rdev, "failed to set suspend state\n");
rdev->constraints = NULL;
goto out;
}
}
Expand All @@ -924,13 +922,15 @@ static int set_machine_constraints(struct regulator_dev *rdev,
ret = ops->enable(rdev);
if (ret < 0) {
rdev_err(rdev, "failed to enable\n");
rdev->constraints = NULL;
goto out;
}
}

print_constraints(rdev);
return 0;
out:
kfree(rdev->constraints);
rdev->constraints = NULL;
return ret;
}

Expand Down Expand Up @@ -2701,6 +2701,7 @@ struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
unset_regulator_supplies(rdev);

scrub:
kfree(rdev->constraints);
device_unregister(&rdev->dev);
/* device core frees rdev */
rdev = ERR_PTR(ret);
Expand Down

0 comments on commit e732a25

Please sign in to comment.