summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/tristate_gpios.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/tristate_gpios.c b/src/lib/tristate_gpios.c
index 49f060c9c2..8e93e3704a 100644
--- a/src/lib/tristate_gpios.c
+++ b/src/lib/tristate_gpios.c
@@ -62,7 +62,7 @@ int gpio_get_in_tristate_values(gpio_t gpio[], int num_gpio, int tertiary)
* 1: pull up
* 2: floating
*/
- for (index = 0; index < num_gpio; ++index) {
+ for (index = num_gpio - 1; index >= 0; --index) {
if (tertiary)
id *= 3;
else