Skip to content

Commit e65a1b7

Browse files
t-8chsre
authored andcommitted
power: supply: cros_charge-control: allow start_threshold == end_threshold
Allow setting the start and stop thresholds to the same value. There is no reason to disallow it. Suggested-by: Thomas Koch <linrunner@gmx.net> Fixes: c6ed48e ("power: supply: add ChromeOS EC based charge control driver") Cc: stable@vger.kernel.org Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://lore.kernel.org/r/20241208-cros_charge-control-v2-v1-2-8d168d0f08a3@weissschuh.net Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
1 parent e5f84d1 commit e65a1b7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/power/supply/cros_charge-control.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,11 @@ static ssize_t cros_chctl_store_threshold(struct device *dev, struct cros_chctl_
139139
return -EINVAL;
140140

141141
if (is_end_threshold) {
142-
if (val <= priv->current_start_threshold)
142+
if (val < priv->current_start_threshold)
143143
return -EINVAL;
144144
priv->current_end_threshold = val;
145145
} else {
146-
if (val >= priv->current_end_threshold)
146+
if (val > priv->current_end_threshold)
147147
return -EINVAL;
148148
priv->current_start_threshold = val;
149149
}

0 commit comments

Comments
 (0)