Commit 35ae7f96 authored by Janusz Krzysztofik's avatar Janusz Krzysztofik Committed by Linus Walleij

gpiolib: Fix missing updates of bitmap index

In new code introduced by commit b17566a6 ("gpiolib: Implement fast
processing path in get/set array"), bitmap index is not updated with
next found zero bit position as it should while skipping over pins
already processed via fast bitmap path, possibly resulting in an
infinite loop.  Fix it.
Signed-off-by: default avatarJanusz Krzysztofik <jmkrzyszt@gmail.com>
Tested-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 212d7069
...@@ -2880,7 +2880,7 @@ int gpiod_get_array_value_complex(bool raw, bool can_sleep, ...@@ -2880,7 +2880,7 @@ int gpiod_get_array_value_complex(bool raw, bool can_sleep,
__set_bit(hwgpio, mask); __set_bit(hwgpio, mask);
if (array_info) if (array_info)
find_next_zero_bit(array_info->get_mask, i = find_next_zero_bit(array_info->get_mask,
array_size, i); array_size, i);
else else
i++; i++;
...@@ -2905,7 +2905,8 @@ int gpiod_get_array_value_complex(bool raw, bool can_sleep, ...@@ -2905,7 +2905,8 @@ int gpiod_get_array_value_complex(bool raw, bool can_sleep,
trace_gpio_value(desc_to_gpio(desc), 1, value); trace_gpio_value(desc_to_gpio(desc), 1, value);
if (array_info) if (array_info)
find_next_zero_bit(array_info->get_mask, i, j); j = find_next_zero_bit(array_info->get_mask, i,
j);
else else
j++; j++;
} }
...@@ -3192,7 +3193,7 @@ int gpiod_set_array_value_complex(bool raw, bool can_sleep, ...@@ -3192,7 +3193,7 @@ int gpiod_set_array_value_complex(bool raw, bool can_sleep,
} }
if (array_info) if (array_info)
find_next_zero_bit(array_info->set_mask, i = find_next_zero_bit(array_info->set_mask,
array_size, i); array_size, i);
else else
i++; i++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment