[U-Boot] [PATCH v2 1/2] dm: device: fail uclass_find_first_device() if list_empty
Simon Glass
sjg at chromium.org
Thu Jan 31 10:04:28 UTC 2019
On Fri, 25 Jan 2019 at 05:40, Marcel Ziswiler <marcel at ziswiler.com> wrote:
>
> From: Marcel Ziswiler <marcel.ziswiler at toradex.com>
>
> 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 at toradex.com>
>
> ---
>
> Changes in v2:
> - Update dm_test_uclass_devices_find() to test this behaviour as
> suggested by Simon.
>
> drivers/core/uclass.c | 2 +-
> test/dm/core.c | 4 ++++
> 2 files changed, 5 insertions(+), 1 deletion(-)
Reviewed-by: Simon Glass <sjg at chromium.org>
More information about the U-Boot
mailing list