From c1d6f91952d0761f61b0f0f96e4c7aa32eee2788 Mon Sep 17 00:00:00 2001 From: Przemyslaw Marczak Date: Wed, 15 Apr 2015 13:07:17 +0200 Subject: 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 Cc: Simon Glass Acked-by: Simon Glass --- include/dm/uclass-internal.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'include') diff --git a/include/dm/uclass-internal.h b/include/dm/uclass-internal.h index ae2a93d7d4..befbae5a01 100644 --- a/include/dm/uclass-internal.h +++ b/include/dm/uclass-internal.h @@ -23,6 +23,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 * -- cgit v1.2.1