diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2022-02-09 21:08:06 +0300 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2022-02-11 04:18:35 +0300 |
commit | ba2ab85951c91a140a8fa51d8347d54e59ec009d (patch) | |
tree | 89b180dde80e9608c2da1783e870c2e4db306fef /drivers/pinctrl/pinctrl-k210.c | |
parent | dfd42facf1e4ada021b939b4e19c935dcdd55566 (diff) | |
download | linux-ba2ab85951c91a140a8fa51d8347d54e59ec009d.tar.xz |
pinctrl: fix loop in k210_pinconf_get_drive()
The loop exited too early so the k210_pinconf_drive_strength[0] array
element was never used.
Fixes: d4c34d09ab03 ("pinctrl: Add RISC-V Canaan Kendryte K210 FPIOA driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20220209180804.GA18385@kili
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-k210.c')
-rw-r--r-- | drivers/pinctrl/pinctrl-k210.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pinctrl/pinctrl-k210.c b/drivers/pinctrl/pinctrl-k210.c index 49e32684dbb2..e3d03f2de7ef 100644 --- a/drivers/pinctrl/pinctrl-k210.c +++ b/drivers/pinctrl/pinctrl-k210.c @@ -482,7 +482,7 @@ static int k210_pinconf_get_drive(unsigned int max_strength_ua) { int i; - for (i = K210_PC_DRIVE_MAX; i; i--) { + for (i = K210_PC_DRIVE_MAX; i >= 0; i--) { if (k210_pinconf_drive_strength[i] <= max_strength_ua) return i; } |