mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-01 10:42:11 +00:00
regulator: core: Ignore unset max_uA constraints in current limit check
We should only consider max_uA constraints if they are explicitly defined. In cases where it is not set, we should assume the regulator has no current limit. Signed-off-by: Kory Maincent <kory.maincent@bootlin.com> Link: https://patch.msgid.link/20241121-feature_poe_port_prio-v3-2-83299fa6967c@bootlin.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
5262bcbb41
commit
351f2bfe63
@ -497,7 +497,8 @@ static int regulator_check_current_limit(struct regulator_dev *rdev,
|
|||||||
return -EPERM;
|
return -EPERM;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*max_uA > rdev->constraints->max_uA)
|
if (*max_uA > rdev->constraints->max_uA &&
|
||||||
|
rdev->constraints->max_uA)
|
||||||
*max_uA = rdev->constraints->max_uA;
|
*max_uA = rdev->constraints->max_uA;
|
||||||
if (*min_uA < rdev->constraints->min_uA)
|
if (*min_uA < rdev->constraints->min_uA)
|
||||||
*min_uA = rdev->constraints->min_uA;
|
*min_uA = rdev->constraints->min_uA;
|
||||||
|
Loading…
Reference in New Issue
Block a user