diff options
| author | Simon Glass <[email protected]> | 2019-09-25 08:55:55 -0600 |
|---|---|---|
| committer | Bin Meng <[email protected]> | 2019-10-08 13:57:38 +0800 |
| commit | 4805a7af8ebd4c604e1e32355927ec5035685121 (patch) | |
| tree | fa15885bb421070d45c336c3a2e02a9744de4dfe /test | |
| parent | ea14778d0680f8a3f262a06ceb52ea17deb6a104 (diff) | |
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 <[email protected]>
Reviewed-by: Bin Meng <[email protected]>
Tested-by: Bin Meng <[email protected]>
Diffstat (limited to 'test')
| -rw-r--r-- | test/dm/core.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/test/dm/core.c b/test/dm/core.c index edd55b05d6e..f74c4308439 100644 --- a/test/dm/core.c +++ b/test/dm/core.c @@ -749,8 +749,7 @@ static int dm_test_uclass_devices_find(struct unit_test_state *uts) ut_assert(dev); } - ret = uclass_find_first_device(UCLASS_TEST_DUMMY, &dev); - ut_assert(ret == -ENODEV); + ut_assertok(uclass_find_first_device(UCLASS_TEST_DUMMY, &dev)); ut_assert(!dev); return 0; |
