diff options
author | Simon Glass <sjg@chromium.org> | 2015-01-25 15:27:10 (GMT) |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2015-01-30 00:09:56 (GMT) |
commit | 83c7e434c9dd3ca81f8b763e23c1881b973bcf2f (patch) | |
tree | c0fc096ee51bbcd66ccabd77826e236f49329845 /drivers/core/uclass.c | |
parent | 1603bf3cc189da65362b83b85831e094a2fe8516 (diff) | |
download | u-boot-fsl-qoriq-83c7e434c9dd3ca81f8b763e23c1881b973bcf2f.tar.xz |
dm: core: Allow uclass to set up a device's child before it is probed
Some buses need to set up their devices before they can be used. This setup
may well be common to all buses in a particular uclass. Support a common
pre-probe method for the uclass, called before any bus devices are probed.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Diffstat (limited to 'drivers/core/uclass.c')
-rw-r--r-- | drivers/core/uclass.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c index a544551..289a5d2 100644 --- a/drivers/core/uclass.c +++ b/drivers/core/uclass.c @@ -391,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; |