dm: core: Add a function to find the first inactive child
Some devices have children and want to press an existing inactive child into service when needed. Add a function to help with this. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -519,6 +519,21 @@ int device_find_first_child(struct udevice *parent, struct udevice **devp);
|
||||
*/
|
||||
int device_find_next_child(struct udevice **devp);
|
||||
|
||||
/**
|
||||
* device_find_first_inactive_child() - Find the first inactive child
|
||||
*
|
||||
* This is used to locate an existing child of a device which is of a given
|
||||
* uclass.
|
||||
*
|
||||
* @parent: Parent device to search
|
||||
* @uclass_id: Uclass to look for
|
||||
* @devp: Returns device found, if any
|
||||
* @return 0 if found, else -ENODEV
|
||||
*/
|
||||
int device_find_first_inactive_child(struct udevice *parent,
|
||||
enum uclass_id uclass_id,
|
||||
struct udevice **devp);
|
||||
|
||||
/**
|
||||
* device_has_children() - check if a device has any children
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user