Skip to contentSkip to conversation

regulator: max8973: Don't override control1 variable when set ramp delay bits

PATCH Applied Axel Lin 3 participants 3 messages Apr 23, 2013 – Apr 24, 2013 Voltage and current regulator framework

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 regulator: max8973: Don't override control1 variable when set ramp delay bits

Current code overrides control1 variable when setting ramp delay bits. Fix it by just setting ramp_delay bits.

---
 drivers/regulator/max8973-regulator.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/regulator/max8973-regulator.c +5 -5
index 9a8ea91..adb1414 100644
@@ -274,15 +274,15 @@ static int max8973_init_dcdc(struct max8973_chip *max,
 	if (pdata->reg_init_data &&
 			pdata->reg_init_data->constraints.ramp_delay) {
 		if (pdata->reg_init_data->constraints.ramp_delay < 25000)
-			control1 = MAX8973_RAMP_12mV_PER_US;
+			control1 |= MAX8973_RAMP_12mV_PER_US;
 		else if (pdata->reg_init_data->constraints.ramp_delay < 50000)
-			control1 = MAX8973_RAMP_25mV_PER_US;
+			control1 |= MAX8973_RAMP_25mV_PER_US;
 		else if (pdata->reg_init_data->constraints.ramp_delay < 200000)
-			control1 = MAX8973_RAMP_50mV_PER_US;
+			control1 |= MAX8973_RAMP_50mV_PER_US;
 		else
-			control1 = MAX8973_RAMP_200mV_PER_US;
+			control1 |= MAX8973_RAMP_200mV_PER_US;
 	} else {
-		control1 = MAX8973_RAMP_12mV_PER_US;
+		control1 |= MAX8973_RAMP_12mV_PER_US;
 		max->desc.ramp_delay = 12500;
 	}
 
Signature · 1 line
1.7.10.4
maintainer Applied
#2 lore raw
In reply to Axel Lin
Quoted 2 lines · Axel Lin

Current code overrides control1 variable when setting ramp delay bits. Fix it by just setting ramp_delay bits.

Applied, thanks. Laxman, please check your acks can be cut'n'pasted - there's regularly things I need to fix up by hand.