Skip to content

Commit ba2ab85

Browse files
Dan Carpenterlinusw
authored andcommitted
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: d4c34d0 ("pinctrl: Add RISC-V Canaan Kendryte K210 FPIOA driver") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Damien Le Moal <[email protected]> Reviewed-by: Sean Anderson <[email protected]> Link: https://lore.kernel.org/r/20220209180804.GA18385@kili Signed-off-by: Linus Walleij <[email protected]>
1 parent dfd42fa commit ba2ab85

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pinctrl/pinctrl-k210.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ static int k210_pinconf_get_drive(unsigned int max_strength_ua)
482482
{
483483
int i;
484484

485-
for (i = K210_PC_DRIVE_MAX; i; i--) {
485+
for (i = K210_PC_DRIVE_MAX; i >= 0; i--) {
486486
if (k210_pinconf_drive_strength[i] <= max_strength_ua)
487487
return i;
488488
}

0 commit comments

Comments
 (0)