dm: core: Switch uclass_*_device_err to use uclass_*_device_check
authorMichal Suchanek <msuchanek@suse.de>
Wed, 12 Oct 2022 19:58:06 +0000 (21:58 +0200)
committerSimon Glass <sjg@chromium.org>
Tue, 18 Oct 2022 03:17:12 +0000 (21:17 -0600)
commite44d7e73fe0d649693d8d0a110cd7632bc919273
tree0e111823c8983133f678e2af9372f0265d0daa65
parent801f71194c54c75e90d723b9be3434b6354fce71
dm: core: Switch uclass_*_device_err to use uclass_*_device_check

The _err variant iterators use the simple iterators without suffix as
basis.

However, there is no user that uclass_next_device_err for iteration,
many users of uclass_first_device_err use it to get the first and
(assumed) only device of an uclass, and a couple that use
uclass_next_device_err to get the device following a known device in the
uclass list.

While there are some truly singleton device classes in which more than
one device cannot exist these are quite rare, and most classes can have
multiple devices even if it is not the case on the SoC's EVB.

In a later patch the simple iterators will be updated to not stop on
error and return next device instead. With this in many cases the code
that expects the first device or an error if it fails to probe may get
the next device instead. Use the _check iterators as the basis of _err
iterators to preserve the old behavior.

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/core/uclass.c
include/dm/uclass.h