Commit e65a1b7f authored by Thomas Weißschuh's avatar Thomas Weißschuh Committed by Sebastian Reichel
Browse files

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: default avatarThomas Koch <linrunner@gmx.net>
Fixes: c6ed48ef ("power: supply: add ChromeOS EC based charge control driver")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarThomas Weißschuh <linux@weissschuh.net>
Link: https://lore.kernel.org/r/20241208-cros_charge-control-v2-v1-2-8d168d0f08a3@weissschuh.net


Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent e5f84d1c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -139,11 +139,11 @@ static ssize_t cros_chctl_store_threshold(struct device *dev, struct cros_chctl_
		return -EINVAL;

	if (is_end_threshold) {
		if (val <= priv->current_start_threshold)
		if (val < priv->current_start_threshold)
			return -EINVAL;
		priv->current_end_threshold = val;
	} else {
		if (val >= priv->current_end_threshold)
		if (val > priv->current_end_threshold)
			return -EINVAL;
		priv->current_start_threshold = val;
	}