]> git.baikalelectronics.ru Git - uboot.git/commit
dm: device: fail uclass_find_first_device() if list_empty
authorMarcel Ziswiler <marcel.ziswiler@toradex.com>
Fri, 1 Feb 2019 15:01:07 +0000 (16:01 +0100)
committerTom Rini <trini@konsulko.com>
Sat, 9 Feb 2019 12:51:00 +0000 (07:51 -0500)
commitcacc0e4b9e3d8d7184de16eb6d54bd4b04f8ad1e
tree5505a39da34f193155977a5d907e4148ce627ea9
parent373534157d3a1f55101eb38b95f2a18264f1ba63
dm: device: fail uclass_find_first_device() if list_empty

While uclass_find_device() fails with -ENODEV in case of list_empty
strangely uclass_find_first_device() returns 0.

Fix uclass_find_first_device() to also fail with -ENODEV instead.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/core/uclass.c
test/dm/core.c