<div dir="ltr"><div><div><div><div><div><div>Hello,<br><br></div>I am currently working on a project which uses I2C devices through libi2c API.<br><br></div>The problem that I am facing is that this function: rtems_libi2c_register_drv actually registeres the device before drvtbl->ops->initialization_entry returns success or failure. This means that it is impossible to probe a device which might be at 2 different I2C addreses on different PCB revisions.<br></div><br></div><div>For a device driver with no initialization function it should make no difference, the function call being ignored, and the minor being returned.<br></div><div>If the device driver has a initialization function, it calls it and makes sure that the return value is 0 before registering the name. If it returns something different than RTEMS_SUCCESS, it makes sure the driver registration returns negative error code (so it's not mistaken with minor number), and does not register the device driver.<br></div><div><br></div>I have attached a patch to solve this problem, and bypass device registration in the filesystem if the initialziation fails.<br></div>Please review the changes and merge if you agree.<br><br></div>Thank you, <br>Alex H.<br></div>