diff options
author | Przemyslaw Marczak <p.marczak@samsung.com> | 2015-04-15 13:07:17 +0200 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2015-04-22 11:03:14 -0600 |
commit | c1d6f91952d0761f61b0f0f96e4c7aa32eee2788 (patch) | |
tree | ed8e55c9ca4e7d6205f5599fdc7c8e72bc7b3785 /include/dm | |
parent | d77447fdb122dab290fb1ad184a62456011e6e06 (diff) | |
download | u-boot-imx-c1d6f91952d0761f61b0f0f96e4c7aa32eee2788.zip u-boot-imx-c1d6f91952d0761f61b0f0f96e4c7aa32eee2788.tar.gz u-boot-imx-c1d6f91952d0761f61b0f0f96e4c7aa32eee2788.tar.bz2 |
dm: core: add internal functions for getting the device without probe
This commit extends the uclass-internal functions by:
- uclass_find_first_device()
- uclass_find_next_device()
For both functions, the returned device is not probed.
After some cleanup, the above functions are called by:
- uclass_first_device()
- uclass_next_device()
for which, the returned device is probed.
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Cc: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/dm')
-rw-r--r-- | include/dm/uclass-internal.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/dm/uclass-internal.h b/include/dm/uclass-internal.h index ae2a93d..befbae5 100644 --- a/include/dm/uclass-internal.h +++ b/include/dm/uclass-internal.h @@ -24,6 +24,28 @@ int uclass_find_device(enum uclass_id id, int index, struct udevice **devp); /** + * uclass_find_first_device() - Return the first device in a uclass + * @id: Id number of the uclass + * #devp: Returns pointer to device, or NULL on error + * + * The device is not prepared for use - this is an internal function + * + * @return 0 if OK (found or not found), -1 on error + */ +int uclass_find_first_device(enum uclass_id id, struct udevice **devp); + +/** + * uclass_find_next_device() - Return the next device in a uclass + * @devp: On entry, pointer to device to lookup. On exit, returns pointer + * to the next device in the same uclass, or NULL if none + * + * The device is not prepared for use - this is an internal function + * + * @return 0 if OK (found or not found), -1 on error + */ +int uclass_find_next_device(struct udevice **devp); + +/** * uclass_bind_device() - Associate device with a uclass * * Connect the device into uclass's list of devices. |