diff options
author | Colin Ian King <colin.king@canonical.com> | 2018-04-20 11:26:23 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-04-23 13:26:05 +0200 |
commit | f97a236801b29f6a8e2ba3957789c3932a908966 (patch) | |
tree | 2b095257cc0952423a2d29de9f47f31b2fe3ab1a /drivers/regulator | |
parent | regulator: Don't return or expect -errno from of_map_mode() (diff) | |
download | linux-f97a236801b29f6a8e2ba3957789c3932a908966.tar.xz linux-f97a236801b29f6a8e2ba3957789c3932a908966.zip |
regulator: wm8350: fix missing increment of loop index i
It seems that the loop index i is not being incremented and hence
potentially the while loop could spin forever. Fortunately with the
data being used this does not appear to happen at the moment.
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/wm8350-regulator.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/regulator/wm8350-regulator.c b/drivers/regulator/wm8350-regulator.c index da9106bd2109..8ad11b074b49 100644 --- a/drivers/regulator/wm8350-regulator.c +++ b/drivers/regulator/wm8350-regulator.c @@ -911,6 +911,7 @@ static unsigned int get_mode(int uA, const struct wm8350_dcdc_efficiency *eff) while (eff[i].uA_load_min != -1) { if (uA >= eff[i].uA_load_min && uA <= eff[i].uA_load_max) return eff[i].mode; + i++; } return REGULATOR_MODE_NORMAL; } |