[U-Boot] [PATCH 1/8] core: Add uclass_{first, next}_device_compat

Simon Glass sjg at chromium.org
Fri Mar 30 08:41:54 UTC 2018


Hi Mario,

On 28 March 2018 at 20:38, Mario Six <mario.six at gdsys.cc> wrote:
> A lot of times one wants to cycle through the devices in a uclass, but
> only certain ones, especially ones identified by their compatibility
> string, and ignore all others (in the best case this procedure should
> not even activate the devices one is not interested in).
>
> Hence, we add a pair of functions similar to uclass_{first,next}_device,
> but taking a compatibility string as an additional argument, which cycle
> through the devices of a uclass that conform to this compatibility
> string.

Can we not use a phandle to find the device? Using raw compatible
strings feel bad (and slow to me).

If not, a please add a sandbox test.

>
> Signed-off-by: Mario Six <mario.six at gdsys.cc>
> ---
>  drivers/core/uclass.c | 33 +++++++++++++++++++++++++++++++++
>  include/dm/uclass.h   | 37 +++++++++++++++++++++++++++++++++++++
>  2 files changed, 70 insertions(+)

Regards,
Simon


More information about the U-Boot mailing list