Hi,

On 8/20/24 11:12 AM, Sahaj Sarup wrote:
[You don't often get email from [email protected]. Learn why this is 
important at https://aka.ms/LearnAboutSenderIdentification ]

Hi,

In `include/i2c.h` , the udevice pointer and return value definition
seems to be confusing.

```
/**
  * i2c_get_chip_for_busnum() - get a device to use to access a chip on
.
.
.
  * @devp: Returns pointer to new device if found or -ENODEV if not
  * found
  */
```

Should this instead be:

```
  * @devp:   Returns pointer to new device or NULL if not found
  * Return:  0 on success, -ENODEV on failure
```


For the @devp part, seems like it as uclass_get_device_by_seq sets it to NULL and i2c_get_chip only modifies it when a device is found.

For the return part... not sure. We don't overwrite the return value we get from functions we call, so not sure we can guarantee that only ENODEV will be returned?

Cheers,
Quentin

Reply via email to