Re: [PATCH v2] regulator: treat regulators with constant volatage as fixed

2012-11-13 Thread Mark Brown
On Tue, Nov 13, 2012 at 10:35:34AM +0100, Marek Szyprowski wrote: > + if (rdev->constraints->valid_ops_mask & REGULATOR_CHANGE_VOLTAGE) > + return rdev->desc->n_voltages ? rdev->desc->n_voltages : > +-EINVAL; The idea here was to avoid the ternery operator

[PATCH v2] regulator: treat regulators with constant volatage as fixed

2012-11-13 Thread Marek Szyprowski
Some drivers has additional logic for fixed regulators. Let regulator core to treat regulators which cannot change their voltage due to applied constraints as fixed. Signed-off-by: Marek Szyprowski --- drivers/regulator/core.c |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff

[PATCH v2] regulator: treat regulators with constant volatage as fixed

2012-11-13 Thread Marek Szyprowski
Some drivers has additional logic for fixed regulators. Let regulator core to treat regulators which cannot change their voltage due to applied constraints as fixed. Signed-off-by: Marek Szyprowski m.szyprow...@samsung.com --- drivers/regulator/core.c |6 +- 1 file changed, 5

Re: [PATCH v2] regulator: treat regulators with constant volatage as fixed

2012-11-13 Thread Mark Brown
On Tue, Nov 13, 2012 at 10:35:34AM +0100, Marek Szyprowski wrote: + if (rdev-constraints-valid_ops_mask REGULATOR_CHANGE_VOLTAGE) + return rdev-desc-n_voltages ? rdev-desc-n_voltages : +-EINVAL; The idea here was to avoid the ternery operator completely.