Skip to content

Commit a0fc8b6

Browse files
Ondrej Jirmanbroonie
authored andcommitted
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 <[email protected]> Acked-by: Chen-Yu Tsai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 502cdd6 commit a0fc8b6

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/regulator/axp20x-regulator.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -381,8 +381,7 @@ static int axp20x_set_ramp_delay(struct regulator_dev *rdev, int ramp)
381381
mask = AXP20X_DCDC2_LDO3_V_RAMP_DCDC2_RATE_MASK |
382382
AXP20X_DCDC2_LDO3_V_RAMP_DCDC2_EN_MASK;
383383
enable = (ramp > 0) ?
384-
AXP20X_DCDC2_LDO3_V_RAMP_DCDC2_EN :
385-
!AXP20X_DCDC2_LDO3_V_RAMP_DCDC2_EN;
384+
AXP20X_DCDC2_LDO3_V_RAMP_DCDC2_EN : 0;
386385
break;
387386
}
388387

@@ -393,8 +392,7 @@ static int axp20x_set_ramp_delay(struct regulator_dev *rdev, int ramp)
393392
mask = AXP20X_DCDC2_LDO3_V_RAMP_LDO3_RATE_MASK |
394393
AXP20X_DCDC2_LDO3_V_RAMP_LDO3_EN_MASK;
395394
enable = (ramp > 0) ?
396-
AXP20X_DCDC2_LDO3_V_RAMP_LDO3_EN :
397-
!AXP20X_DCDC2_LDO3_V_RAMP_LDO3_EN;
395+
AXP20X_DCDC2_LDO3_V_RAMP_LDO3_EN : 0;
398396
break;
399397
}
400398

0 commit comments

Comments
 (0)