[U-Boot] [PATCH 01/27] dm: core: Allow uclass to set up a device's child after it is probed

Bin Meng bmeng.cn at gmail.com
Thu Oct 11 05:14:59 UTC 2018


Hi Simon,

On Thu, Sep 27, 2018 at 9:42 PM Simon Glass <sjg at chromium.org> wrote:
>
> Hi Bin,
>
> On 23 September 2018 at 06:41, Bin Meng <bmeng.cn at gmail.com> wrote:
> > Some buses need to set up their child devices after they are probed.
> > Support a common child_post_probe() method for the uclass.
> >
> > With this change, the two APIs uclass_pre_probe_device() and
> > uclass_post_probe_device() become symmetric.
> >
> > Signed-off-by: Bin Meng <bmeng.cn at gmail.com>
> > ---
> >
> >  drivers/core/uclass.c | 13 ++++++++++++-
> >  include/dm/uclass.h   |  4 +++-
> >  2 files changed, 15 insertions(+), 2 deletions(-)
>
> Another option, perhaps not quite as elegant, is for the driver to
> call into the uclass in its probe() method. We need to balance
> elegance with the cost of adding a new field to the uclass which is
> rarely used. What do you think?
>

Yes, we can use driver's probe() method to achieve the same goal, but
that seems a little bit duplicated effort for every driver. Also I
believe we should make uclass_pre_probe_device() and
uclass_post_probe_device() symmetric.

> Also, this does need some sort of use in sandbox, so can you update
> the test driver to use it?
>

Yes, will add in v2.

Regards,
Bin


More information about the U-Boot mailing list