diff mbox

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

Message ID 1438033652-30435-4-git-send-email-sjg@chromium.org
State Accepted
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass July 27, 2015, 9:47 p.m. UTC
At present this function does not specify its return value. Fix it.

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

 include/dm/device.h | 2 ++
 1 file changed, 2 insertions(+)

Comments

Bin Meng July 28, 2015, 7:47 a.m. UTC | #1
On Tue, Jul 28, 2015 at 5:47 AM, Simon Glass <sjg@chromium.org> wrote:
> At present this function does not specify its return value. Fix it.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>

Reviewed-by: Bin Meng <bmeng.cn@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
Simon Glass Aug. 2, 2015, 11:37 p.m. UTC | #2
On 28 July 2015 at 01:47, Bin Meng <bmeng.cn@gmail.com> wrote:
> On Tue, Jul 28, 2015 at 5:47 AM, Simon Glass <sjg@chromium.org> wrote:
>> At present this function does not specify its return value. Fix it.
>>
>> Signed-off-by: Simon Glass <sjg@chromium.org>
>> ---
>>
>
> Reviewed-by: Bin Meng <bmeng.cn@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()

OK done

>
>  *
>  * @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

Applied to u-boot-x86.
diff mbox

Patch

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);