summaryrefslogtreecommitdiff
path: root/drivers/core/uclass.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-09-25 08:55:55 -0600
committerBin Meng <bmeng.cn@gmail.com>2019-10-08 13:57:38 +0800
commit4805a7af8ebd4c604e1e32355927ec5035685121 (patch)
treefa15885bb421070d45c336c3a2e02a9744de4dfe /drivers/core/uclass.c
parentea14778d0680f8a3f262a06ceb52ea17deb6a104 (diff)
downloadu-boot-4805a7af8ebd4c604e1e32355927ec5035685121.tar.gz
dm: core: Correct the return value for uclass_find_first_device()
This function returns -ENODEV when there is no device. This is inconsistent with other functions, such as uclass_find_next_device(), which returns 0. Update it and tidy up the incorrect '-1' values in the comments. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'drivers/core/uclass.c')
-rw-r--r--drivers/core/uclass.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c
index af575bbeb7..f217876cd2 100644
--- a/drivers/core/uclass.c
+++ b/drivers/core/uclass.c
@@ -225,7 +225,7 @@ int uclass_find_first_device(enum uclass_id id, struct udevice **devp)
if (ret)
return ret;
if (list_empty(&uc->dev_head))
- return -ENODEV;
+ return 0;
*devp = list_first_entry(&uc->dev_head, struct udevice, uclass_node);