diff options
| author | Ingo Molnar <mingo@elte.hu> | 2009-05-11 12:59:32 +0200 | 
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2009-05-11 12:59:37 +0200 | 
| commit | 7961386fe9596e6bf03d09948a73c5df9653325b (patch) | |
| tree | 60fa2586a0d340ef8f7473956eef17430d8250c7 /drivers/regulator/core.c | |
| parent | aa47b7e0f89b9998dad4d1667447e8cb7703ff4e (diff) | |
| parent | 091bf7624d1c90cec9e578a18529f615213ff847 (diff) | |
| download | olio-linux-3.10-7961386fe9596e6bf03d09948a73c5df9653325b.tar.xz olio-linux-3.10-7961386fe9596e6bf03d09948a73c5df9653325b.zip  | |
Merge commit 'v2.6.30-rc5' into sched/core
Merge reason: sched/core was on .30-rc1 before, update to latest fixes
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/regulator/core.c')
| -rw-r--r-- | drivers/regulator/core.c | 19 | 
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 01f7702a805..98c3a74e994 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -540,8 +540,8 @@ static void drms_uA_update(struct regulator_dev *rdev)  	err = regulator_check_drms(rdev);  	if (err < 0 || !rdev->desc->ops->get_optimum_mode || -	    !rdev->desc->ops->get_voltage || !rdev->desc->ops->set_mode); -	return; +	    !rdev->desc->ops->get_voltage || !rdev->desc->ops->set_mode) +		return;  	/* get output voltage */  	output_uV = rdev->desc->ops->get_voltage(rdev); @@ -703,10 +703,13 @@ static int set_machine_constraints(struct regulator_dev *rdev,  		int	cmin = constraints->min_uV;  		int	cmax = constraints->max_uV; -		/* it's safe to autoconfigure fixed-voltage supplies */ +		/* it's safe to autoconfigure fixed-voltage supplies +		   and the constraints are used by list_voltage. */  		if (count == 1 && !cmin) { -			cmin = INT_MIN; +			cmin = 1;  			cmax = INT_MAX; +			constraints->min_uV = cmin; +			constraints->max_uV = cmax;  		}  		/* voltage constraints are optional */ @@ -2001,8 +2004,8 @@ struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,  	if (regulator_desc->name == NULL || regulator_desc->ops == NULL)  		return ERR_PTR(-EINVAL); -	if (!regulator_desc->type == REGULATOR_VOLTAGE && -	    !regulator_desc->type == REGULATOR_CURRENT) +	if (regulator_desc->type != REGULATOR_VOLTAGE && +	    regulator_desc->type != REGULATOR_CURRENT)  		return ERR_PTR(-EINVAL);  	if (!init_data) @@ -2080,6 +2083,10 @@ out:  scrub:  	device_unregister(&rdev->dev); +	/* device core frees rdev */ +	rdev = ERR_PTR(ret); +	goto out; +  clean:  	kfree(rdev);  	rdev = ERR_PTR(ret);  |