RTEMS | libi2c: Use RTEMS thread API and support initialization at device driver level (!821)

Vijay Banerjee (@vijay) gitlab at rtems.org
Sun Dec 7 08:40:13 UTC 2025




Vijay Banerjee commented on a discussion on cpukit/libi2c/libi2c.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/821#note_136915

 >     * op failed.
 > -   * Let 'init' handle 'is_initialized'...
 > +   * Let 'init' handle 'rtems_libi2c_is_initialized'...
 >     */
 >    sc = rtems_io_register_driver (0, &rtems_libi2c_io_ops, &rtems_libi2c_major);
 >    if (RTEMS_SUCCESSFUL != sc) {
 >      safe_printf(
 >               DRVNM "Claiming driver slot failed (rtems status code %i)\n",
 >               sc);
 > -    if (libmutex != RTEMS_ID_NONE) {
 > -      rtems_semaphore_delete (libmutex);
 > -    }
 > -    libmutex = RTEMS_ID_NONE;
 > -    is_initialized = false;
 > +    rtems_mutex_destroy(&libmutex);
 > +    rtems_libi2c_is_initialized = false;

I added a mutex lock in the new changes.

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/821#note_136915
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20251207/dd0669ef/attachment-0001.htm>


More information about the bugs mailing list