From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bin Meng Date: Thu, 11 Oct 2018 13:14:59 +0800 Subject: [U-Boot] [PATCH 01/27] dm: core: Allow uclass to set up a device's child after it is probed In-Reply-To: References: <1537710145-1888-1-git-send-email-bmeng.cn@gmail.com> <1537710145-1888-2-git-send-email-bmeng.cn@gmail.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Simon, On Thu, Sep 27, 2018 at 9:42 PM Simon Glass wrote: > > Hi Bin, > > On 23 September 2018 at 06:41, Bin Meng 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 > > --- > > > > 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