mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 10:39:08 +00:00
dm: core: Allow uclass to set up a device's child after it is probed
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@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
a6d4b0608b
commit
651d0c019a
2 changed files with 15 additions and 2 deletions
|
@ -687,8 +687,19 @@ int uclass_pre_probe_device(struct udevice *dev)
|
|||
|
||||
int uclass_post_probe_device(struct udevice *dev)
|
||||
{
|
||||
struct uclass_driver *uc_drv = dev->uclass->uc_drv;
|
||||
struct uclass_driver *uc_drv;
|
||||
int ret;
|
||||
|
||||
if (dev->parent) {
|
||||
uc_drv = dev->parent->uclass->uc_drv;
|
||||
if (uc_drv->child_post_probe) {
|
||||
ret = uc_drv->child_post_probe(dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
uc_drv = dev->uclass->uc_drv;
|
||||
if (uc_drv->post_probe)
|
||||
return uc_drv->post_probe(dev);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue