Re: [PATCH v6 10/10] i2c: cgbc: Register known I2C devices on the bus

From: Thomas Richard

Date: Thu Nov 26 2026 - 12:53:24 EST


On 11/26/26 6:47 PM, Andi Shyti wrote:
> Hi Thomas,
>
> ...
>
>> @@ -385,7 +385,15 @@ static int cgbc_i2c_probe(struct platform_device *pdev)
>> if (ret)
>> return dev_err_probe(i2c->dev, ret, "Failed to get I2C bus frequency");
>>
>> - return i2c_add_numbered_adapter(&i2c->adap);
>> + ret = i2c_add_numbered_adapter(&i2c->adap);
>> + if (ret)
>> + return ret;
>> +
>> + /* Add known devices to the bus */
>> + for (i = 0; i < pdata->nb_devices; i++)
>> + i2c_new_client_device(&i2c->adap, pdata->devices + i);
>
> Please handle return values here.
>
Should the adapter probe return an error if we fail to add a new device
to the bus?

Best Regards,
Thomas