mirror of
https://github.com/AsahiLinux/u-boot
synced 2025-02-17 22:49:02 +00:00
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 max_count. Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com> Acked-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
f9f788f072
commit
2984e7a102
1 changed files with 1 additions and 5 deletions
|
@ -590,11 +590,7 @@ int gpio_request_list_by_name_nodev(const void *blob, int node,
|
|||
int count;
|
||||
int ret;
|
||||
|
||||
for (count = 0; ; count++) {
|
||||
if (count >= max_count) {
|
||||
ret = -ENOSPC;
|
||||
goto err;
|
||||
}
|
||||
for (count = 0; count < max_count; count++) {
|
||||
ret = _gpio_request_by_name_nodev(blob, node, list_name, count,
|
||||
&desc[count], flags, true);
|
||||
if (ret == -ENOENT)
|
||||
|
|
Loading…
Add table
Reference in a new issue