diff options
author | Simon Glass <sjg@chromium.org> | 2014-07-23 06:55:21 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2014-07-23 14:08:37 +0100 |
commit | a327dee0f40bcdebaba1a3e47f2b9f1ceb970d2a (patch) | |
tree | 20ba09ee61b51416bc86808abf7315fe6266e1ed /include/dm/device.h | |
parent | e59f458de6999b8a786da857e653db6777f675ca (diff) | |
download | u-boot-a327dee0f40bcdebaba1a3e47f2b9f1ceb970d2a.tar.gz u-boot-a327dee0f40bcdebaba1a3e47f2b9f1ceb970d2a.tar.bz2 u-boot-a327dee0f40bcdebaba1a3e47f2b9f1ceb970d2a.zip |
dm: Add child_pre_probe() and child_post_remove() methods
Some devices (particularly bus devices) must track their children, knowing
when a new child is added so that it can be set up for communication on the
bus.
Add a child_pre_probe() method to provide this feature, and a corresponding
child_post_remove() method.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/dm/device.h')
-rw-r--r-- | include/dm/device.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/dm/device.h b/include/dm/device.h index 20207ce61a..c8a4072bcf 100644 --- a/include/dm/device.h +++ b/include/dm/device.h @@ -118,6 +118,10 @@ struct udevice_id { * @remove: Called to remove a device, i.e. de-activate it * @unbind: Called to unbind a device from its driver * @ofdata_to_platdata: Called before probe to decode device tree data + * @child_pre_probe: Called before a child device is probed. The device has + * memory allocated but it has not yet been probed. + * @child_post_remove: Called after a child device is removed. The device + * has memory allocated but its device_remove() method has been called. * @priv_auto_alloc_size: If non-zero this is the size of the private data * to be allocated in the device's ->priv pointer. If zero, then the driver * is responsible for allocating any data required. @@ -143,6 +147,8 @@ struct driver { int (*remove)(struct udevice *dev); int (*unbind)(struct udevice *dev); int (*ofdata_to_platdata)(struct udevice *dev); + int (*child_pre_probe)(struct udevice *dev); + int (*child_post_remove)(struct udevice *dev); int priv_auto_alloc_size; int platdata_auto_alloc_size; int per_child_auto_alloc_size; |