drivers: regulator: fix set_current_limit limits check
Only current ranges out of the allowed range have to be skipped. Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
parent
8c6819120e
commit
63c005d3b4
1 changed files with 1 additions and 1 deletions
|
@ -189,7 +189,7 @@ int regulator_set_current_limit(const struct device *dev, int32_t min_ua,
|
|||
}
|
||||
|
||||
/* current limit may not be allowed, even if supported */
|
||||
if ((min_ua < config->min_ua) || (max_ua > config->max_ua)) {
|
||||
if ((min_ua > config->max_ua) || (max_ua < config->min_ua)) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue