Commit a0fc8b6a authored by Ondrej Jirman's avatar Ondrej Jirman Committed by Mark Brown

regulator: axp20x: Fix misleading use of negation

It works incidentally, because AXP20X_DCDC2_LDO3_V_RAMP_DCDC2_EN
is non-zero, but the false branch value really should be just 0.
Signed-off-by: default avatarOndrej Jirman <megous@megous.com>
Acked-by: default avatarChen-Yu Tsai <wens@csie.org>
Link: https://lore.kernel.org/r/20200222235634.243805-1-megous@megous.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 502cdd60
......@@ -381,8 +381,7 @@ static int axp20x_set_ramp_delay(struct regulator_dev *rdev, int ramp)
mask = AXP20X_DCDC2_LDO3_V_RAMP_DCDC2_RATE_MASK |
AXP20X_DCDC2_LDO3_V_RAMP_DCDC2_EN_MASK;
enable = (ramp > 0) ?
AXP20X_DCDC2_LDO3_V_RAMP_DCDC2_EN :
!AXP20X_DCDC2_LDO3_V_RAMP_DCDC2_EN;
AXP20X_DCDC2_LDO3_V_RAMP_DCDC2_EN : 0;
break;
}
......@@ -393,8 +392,7 @@ static int axp20x_set_ramp_delay(struct regulator_dev *rdev, int ramp)
mask = AXP20X_DCDC2_LDO3_V_RAMP_LDO3_RATE_MASK |
AXP20X_DCDC2_LDO3_V_RAMP_LDO3_EN_MASK;
enable = (ramp > 0) ?
AXP20X_DCDC2_LDO3_V_RAMP_LDO3_EN :
!AXP20X_DCDC2_LDO3_V_RAMP_LDO3_EN;
AXP20X_DCDC2_LDO3_V_RAMP_LDO3_EN : 0;
break;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment