diff options
author | Tom Rini <trini@ti.com> | 2015-01-30 09:24:42 -0500 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2015-01-30 09:24:42 -0500 |
commit | 8e3da9dd113699eed2fa05fcde3c55a2ff410913 (patch) | |
tree | 4eb27bc3dc9f86e05dcd9f77eca18d0f061ee0a9 /drivers/core/uclass.c | |
parent | 0f274f5376f02ccf30327bf3e5c88d26d3ea8827 (diff) | |
parent | 85df958ce267c602a4ec5f1e41f336c5a8d3b441 (diff) | |
download | u-boot-imx-8e3da9dd113699eed2fa05fcde3c55a2ff410913.zip u-boot-imx-8e3da9dd113699eed2fa05fcde3c55a2ff410913.tar.gz u-boot-imx-8e3da9dd113699eed2fa05fcde3c55a2ff410913.tar.bz2 |
Merge branch 'master' of git://git.denx.de/u-boot-dm
Diffstat (limited to 'drivers/core/uclass.c')
-rw-r--r-- | drivers/core/uclass.c | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c index 901b06e..289a5d2 100644 --- a/drivers/core/uclass.c +++ b/drivers/core/uclass.c @@ -319,18 +319,29 @@ int uclass_bind_device(struct udevice *dev) int ret; uc = dev->uclass; - list_add_tail(&dev->uclass_node, &uc->dev_head); + if (dev->parent) { + struct uclass_driver *uc_drv = dev->parent->uclass->uc_drv; + + if (uc_drv->child_post_bind) { + ret = uc_drv->child_post_bind(dev); + if (ret) + goto err; + } + } if (uc->uc_drv->post_bind) { ret = uc->uc_drv->post_bind(dev); - if (ret) { - list_del(&dev->uclass_node); - return ret; - } + if (ret) + goto err; } return 0; +err: + /* There is no need to undo the parent's post_bind call */ + list_del(&dev->uclass_node); + + return ret; } int uclass_unbind_device(struct udevice *dev) @@ -380,6 +391,19 @@ int uclass_resolve_seq(struct udevice *dev) return seq; } +int uclass_pre_probe_child(struct udevice *dev) +{ + struct uclass_driver *uc_drv; + + if (!dev->parent) + return 0; + uc_drv = dev->parent->uclass->uc_drv; + if (uc_drv->child_pre_probe) + return uc_drv->child_pre_probe(dev); + + return 0; +} + int uclass_post_probe_device(struct udevice *dev) { struct uclass_driver *uc_drv = dev->uclass->uc_drv; |