summaryrefslogtreecommitdiff
path: root/include/dm/uclass.h
diff options
context:
space:
mode:
authorPatrice Chotard <patrice.chotard@st.com>2018-10-24 14:10:15 +0200
committerTom Rini <trini@konsulko.com>2018-11-16 16:51:55 -0500
commitf6abd5389ceab5fce185126c2364a324465fafbe (patch)
tree2b3387cdadc4dd9649b5f0b3785d5d945d8b2ca0 /include/dm/uclass.h
parent8bbb5b20852aa81024eb7b2dcc3eb58275e83bb0 (diff)
dm: uclass: Add uclass_next_device_err() to return a valid device
Similarly to uclass_first_device_err(), add uclass_next_device_err() which returns an error if there are no next devices in that uclass. Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/dm/uclass.h')
-rw-r--r--include/dm/uclass.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/dm/uclass.h b/include/dm/uclass.h
index 4ef0d0f0c0..93f761c96e 100644
--- a/include/dm/uclass.h
+++ b/include/dm/uclass.h
@@ -308,6 +308,18 @@ int uclass_first_device_err(enum uclass_id id, struct udevice **devp);
int uclass_next_device(struct udevice **devp);
/**
+ * uclass_next_device_err() - Get the next device in a uclass
+ *
+ * The device returned is probed if necessary, and ready for use
+ *
+ * @devp: On entry, pointer to device to lookup. On exit, returns pointer
+ * to the next device in the uclass if no error occurred, or -ENODEV if
+ * there is no next device.
+ * @return 0 if found, -ENODEV if not found, other -ve on error
+ */
+int uclass_next_device_err(struct udevice **devp);
+
+/**
* uclass_first_device_check() - Get the first device in a uclass
*
* The device returned is probed if necessary, and ready for use