power: supply: cros_charge-control: allow start_threshold == end_threshold

commit e65a1b7fad0e112573eea7d64d4ab4fc513b8695 upstream.

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: c6ed48ef52 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Thomas Weißschuh
2024-12-08 15:59:27 +01:00
committed by Greg Kroah-Hartman
parent 77e6c8adf8
commit 5792ae1cb1
+2 -2
View File
@@ -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;
}