[U-Boot] [PATCH 03/15] dm: Add a return value comment to device_get_child()

Bin Meng bmeng.cn at gmail.com
Tue Jul 28 09:47:19 CEST 2015


On Tue, Jul 28, 2015 at 5:47 AM, Simon Glass <sjg at chromium.org> wrote:
> At present this function does not specify its return value. Fix it.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
>

Reviewed-by: Bin Meng <bmeng.cn at gmail.com>

But please see comments below.

>  include/dm/device.h | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/include/dm/device.h b/include/dm/device.h
> index 9fa0048..dd9cef4 100644
> --- a/include/dm/device.h
> +++ b/include/dm/device.h
> @@ -318,6 +318,8 @@ const char *dev_get_uclass_name(struct udevice *dev);
>   * @dev:       Parent device to check
>   * @index:     Child index
>   * @devp:      Returns pointer to device
> + * @return 0 if OK, -ENODEV if no such device, other error if the device fails
> + *        to probe
>   */
>  int device_get_child(struct udevice *parent, int index, struct udevice **devp);
>
> --

Can we also fix the wrong comment of device_find_next_child()?

/**
 * device_find_first_child() - Find the first child of a device

This line should be changed to describe device_find_next_child()

 *
 * @devp: Pointer to previous child device on entry. Returns pointer to next
 *              child device, or NULL if none
 * @return 0
 */
int device_find_next_child(struct udevice **devp);


Regards,
Bin


More information about the U-Boot mailing list