Skip to content

Commit 351f2bf

Browse files
kmaincentbroonie
authored andcommitted
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 <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 5262bcb commit 351f2bf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/regulator/core.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,8 @@ static int regulator_check_current_limit(struct regulator_dev *rdev,
497497
return -EPERM;
498498
}
499499

500-
if (*max_uA > rdev->constraints->max_uA)
500+
if (*max_uA > rdev->constraints->max_uA &&
501+
rdev->constraints->max_uA)
501502
*max_uA = rdev->constraints->max_uA;
502503
if (*min_uA < rdev->constraints->min_uA)
503504
*min_uA = rdev->constraints->min_uA;

0 commit comments

Comments
 (0)