Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: c6ed48ef5259 ("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>

authored by

Thomas Weißschuh and committed by
Sebastian Reichel
e65a1b7f e5f84d1c

+2 -2
+2 -2
drivers/power/supply/cros_charge-control.c
··· 139 139 return -EINVAL; 140 140 141 141 if (is_end_threshold) { 142 - if (val <= priv->current_start_threshold) 142 + if (val < priv->current_start_threshold) 143 143 return -EINVAL; 144 144 priv->current_end_threshold = val; 145 145 } else { 146 - if (val >= priv->current_end_threshold) 146 + if (val > priv->current_end_threshold) 147 147 return -EINVAL; 148 148 priv->current_start_threshold = val; 149 149 }