aboutsummaryrefslogtreecommitdiff
path: root/drivers/regulator/axp20x-regulator.c
diff options
context:
space:
mode:
authorGravatar Ondrej Jirman <megous@megous.com> 2020-02-23 00:56:34 +0100
committerGravatar Mark Brown <broonie@kernel.org> 2020-02-24 13:41:35 +0000
commita0fc8b6a3bc52f3a3ecf13eb380e15c470b8e6f8 (patch)
tree2c155f8f1035ca2305d2c3eb408cc72d8278414f /drivers/regulator/axp20x-regulator.c
parentregulator: mp5416: Fix output discharge enable bit for LDOs (diff)
downloadlinux-a0fc8b6a3bc52f3a3ecf13eb380e15c470b8e6f8.tar.gz
linux-a0fc8b6a3bc52f3a3ecf13eb380e15c470b8e6f8.tar.bz2
linux-a0fc8b6a3bc52f3a3ecf13eb380e15c470b8e6f8.zip
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: Ondrej Jirman <megous@megous.com> Acked-by: Chen-Yu Tsai <wens@csie.org> Link: https://lore.kernel.org/r/20200222235634.243805-1-megous@megous.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/axp20x-regulator.c')
-rw-r--r--drivers/regulator/axp20x-regulator.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c
index 16f0c8570036..1e6eb5b1f8d8 100644
--- a/drivers/regulator/axp20x-regulator.c
+++ b/drivers/regulator/axp20x-regulator.c
@@ -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;
}