diff mbox

[1/9] regulator: twl: Remove hardcoded board constraints from driver

Message ID 1317118372-17052-2-git-send-email-rnayak@ti.com
State New
Headers show

Commit Message

Rajendra Nayak Sept. 27, 2011, 10:12 a.m. UTC
Remove the hardcoded .valid_modes_mask and .valid_ops_mask for
each regulator from the twl driver and let the boards pass it.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
---
 drivers/regulator/twl-regulator.c |    8 --------
 1 files changed, 0 insertions(+), 8 deletions(-)

Comments

Mark Brown Sept. 27, 2011, 11:37 a.m. UTC | #1
On Tue, Sep 27, 2011 at 03:42:44PM +0530, Rajendra Nayak wrote:
> Remove the hardcoded .valid_modes_mask and .valid_ops_mask for
> each regulator from the twl driver and let the boards pass it.
> 
> Signed-off-by: Rajendra Nayak <rnayak@ti.com>


> -	/* Constrain board-specific capabilities according to what
> -	 * this driver and the chip itself can actually do.
> -	 */
> -	c = &initdata->constraints;
> -	c->valid_modes_mask &= REGULATOR_MODE_NORMAL | REGULATOR_MODE_STANDBY;
> -	c->valid_ops_mask &= REGULATOR_CHANGE_VOLTAGE
> -				| REGULATOR_CHANGE_MODE
> -				| REGULATOR_CHANGE_STATUS;

This isn't actually hard coding constraints, this is restricting the
constraints passed in further rather than adding new ones.

However should be fine:

Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Rajendra Nayak Sept. 27, 2011, 2:47 p.m. UTC | #2
On Tuesday 27 September 2011 05:07 PM, Mark Brown wrote:
> On Tue, Sep 27, 2011 at 03:42:44PM +0530, Rajendra Nayak wrote:
>> Remove the hardcoded .valid_modes_mask and .valid_ops_mask for
>> each regulator from the twl driver and let the boards pass it.
>>
>> Signed-off-by: Rajendra Nayak<rnayak@ti.com>
>
>
>> -	/* Constrain board-specific capabilities according to what
>> -	 * this driver and the chip itself can actually do.
>> -	 */
>> -	c =&initdata->constraints;
>> -	c->valid_modes_mask&= REGULATOR_MODE_NORMAL | REGULATOR_MODE_STANDBY;
>> -	c->valid_ops_mask&= REGULATOR_CHANGE_VOLTAGE
>> -				| REGULATOR_CHANGE_MODE
>> -				| REGULATOR_CHANGE_STATUS;
>
> This isn't actually hard coding constraints, this is restricting the
> constraints passed in further rather than adding new ones.
>
> However should be fine:
>
> Acked-by: Mark Brown<broonie@opensource.wolfsonmicro.com>

Thanks.
diff mbox

Patch

diff --git a/drivers/regulator/twl-regulator.c b/drivers/regulator/twl-regulator.c
index ee8747f..f696287 100644
--- a/drivers/regulator/twl-regulator.c
+++ b/drivers/regulator/twl-regulator.c
@@ -1027,14 +1027,6 @@  static int __devinit twlreg_probe(struct platform_device *pdev)
 	/* copy the features into regulator data */
 	info->features = (unsigned long)initdata->driver_data;
 
-	/* Constrain board-specific capabilities according to what
-	 * this driver and the chip itself can actually do.
-	 */
-	c = &initdata->constraints;
-	c->valid_modes_mask &= REGULATOR_MODE_NORMAL | REGULATOR_MODE_STANDBY;
-	c->valid_ops_mask &= REGULATOR_CHANGE_VOLTAGE
-				| REGULATOR_CHANGE_MODE
-				| REGULATOR_CHANGE_STATUS;
 	switch (pdev->id) {
 	case TWL4030_REG_VIO:
 	case TWL4030_REG_VDD1: