Re: [PATCH] tee: optee: rework TA bus scanning code

Ilias Apalodimas
2022-08-26T09:19:21Z

Hey Etienne, Jens

[...]

> > > - if (IS_ENABLED(CONFIG_RNG_OPTEE)) {
> > > - ret = device_bind_driver(dev, "optee-rng", "optee-rng", &child);
> > > +
> > > + for (i = 0; i < MAX_TEE_BUS_DEV_COUNT; i++) {
>
> I would use ARRAY_SIZE(optee_bus_probe) straight here. Macro
> indirection is not really useful imho.

Sure

>
> > > + ret = device_bind_driver(dev, optee_bus_probe[i].drv_name,
> > > + optee_bus_probe[i].dev_name, &child);
> > > if (ret)
> > > return ret;
> >
> > I wonder which behaviour is most useful. Disable OP-TEE support
> > completely if there's some error when binding dependent drivers or to
> > just complain a bit but continue.
>
> I agree with you, this should better print the status and proceed with
> the next driver.
> There are other occurrences of such behaviour in U-Boot.

I also agree, however this changes the behaviour of *existing* code, which
I tried to avoid. Since you both think it's better, I'll just add a
log_err() on v2 and continue.

Thanks
/Ilias

>
> Br,
> etienne
>
>
> >
> > Cheers,
> > Jens
> >
> >
> > >
> > > }
> > > --
> > > 2.34.1
> > >