diff mbox

[U-Boot,v2,1/3] dm: core: Clarify uclass_first/next_device() comments

Message ID 20170424021045.11320-1-sjg@chromium.org
State Accepted
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass April 24, 2017, 2:10 a.m. UTC
These are not as clear as they could be. Tidy them up a bit. Also fix a
tiny code-style nit.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v2: None

 drivers/core/uclass.c |  3 +--
 include/dm/uclass.h   | 13 +++++++++++--
 2 files changed, 12 insertions(+), 4 deletions(-)

Comments

Simon Glass June 15, 2017, 7:21 p.m. UTC | #1
These are not as clear as they could be. Tidy them up a bit. Also fix a
tiny code-style nit.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v2: None

 drivers/core/uclass.c |  3 +--
 include/dm/uclass.h   | 13 +++++++++++--
 2 files changed, 12 insertions(+), 4 deletions(-)

Applied to u-boot-dm, thanks!
diff mbox

Patch

diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c
index 04fb45b01a..42613031ff 100644
--- a/drivers/core/uclass.c
+++ b/drivers/core/uclass.c
@@ -342,8 +342,7 @@  int uclass_get_device_by_driver(enum uclass_id id,
 	return -ENODEV;
 }
 
-int uclass_get_device_tail(struct udevice *dev, int ret,
-				  struct udevice **devp)
+int uclass_get_device_tail(struct udevice *dev, int ret, struct udevice **devp)
 {
 	if (ret)
 		return ret;
diff --git a/include/dm/uclass.h b/include/dm/uclass.h
index b583aa869b..63da868ae5 100644
--- a/include/dm/uclass.h
+++ b/include/dm/uclass.h
@@ -224,8 +224,13 @@  int uclass_get_device_by_driver(enum uclass_id id, const struct driver *drv,
  *
  * The device returned is probed if necessary, and ready for use
  *
+ * This function is useful to start iterating through a list of devices which
+ * are functioning correctly and can be probed.
+ *
  * @id: Uclass ID to look up
- * @devp: Returns pointer to the first device in that uclass, or NULL if none
+ * @devp: Returns pointer to the first device in that uclass if no error
+ * occurred, or NULL if there is no first device, or an error occurred with
+ * that device.
  * @return 0 if OK (found or not found), other -ve on error
  */
 int uclass_first_device(enum uclass_id id, struct udevice **devp);
@@ -246,8 +251,12 @@  int uclass_first_device_err(enum uclass_id id, struct udevice **devp);
  *
  * The device returned is probed if necessary, and ready for use
  *
+ * This function is useful to start iterating through a list of devices which
+ * are functioning correctly and can be probed.
+ *
  * @devp: On entry, pointer to device to lookup. On exit, returns pointer
- * to the next device in the same uclass, or NULL if none
+ * to the next device in the uclass if no error occurred, or NULL if there is
+ * no next device, or an error occurred with that next device.
  * @return 0 if OK (found or not found), other -ve on error
  */
 int uclass_next_device(struct udevice **devp);