Commit 2984e7a1 authored by Przemyslaw Marczak's avatar Przemyslaw Marczak Committed by Simon Glass
Browse files

dm: gpio: request list: return the count if requests max_count reached

The function gpio_request_list_by_name_nodev() returned -ENOSPC error,
when the loop count was greater than requested count. This was wrong,
because function should return the requested gpio count, when meets
the call request without errors. Now, the loop ends on requested
Signed-off-by: default avatarPrzemyslaw Marczak <>
Acked-by: default avatarSimon Glass <>
parent f9f788f0
...@@ -590,11 +590,7 @@ int gpio_request_list_by_name_nodev(const void *blob, int node, ...@@ -590,11 +590,7 @@ int gpio_request_list_by_name_nodev(const void *blob, int node,
int count; int count;
int ret; int ret;
for (count = 0; ; count++) { for (count = 0; count < max_count; count++) {
if (count >= max_count) {
ret = -ENOSPC;
goto err;
ret = _gpio_request_by_name_nodev(blob, node, list_name, count, ret = _gpio_request_by_name_nodev(blob, node, list_name, count,
&desc[count], flags, true); &desc[count], flags, true);
if (ret == -ENOENT) if (ret == -ENOENT)
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