Skip to content
Commit 19213d7a authored by Rasmus Villemoes's avatar Rasmus Villemoes Committed by Tom Rini
Browse files

sysinfo: gpio: fix loop over DT "revisions" array



There can certainly be a lot more elements in the "revisions" (and
"names") arrays than there are gpios used to form the trinary number
we're searching for; we simply don't know the array size up-front.

Nor do we need to, because the loop body already knows to recognize
-EOVERFLOW as "not that many elements present" (and we have a test
that specifically ensures that dev_read_u32_index() returns exactly
that). So just drop the i < priv->gpio_num condition.

While in here, fix the weird placement of the default: keyword.

Signed-off-by: default avatarRasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: default avatarSimon Glass <sjg@chromium.org>
Reviewed-by: default avatarSean Anderson <sean.anderson@seco.com>
parent 732b0825
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment