Aaron Nyholm commented on a discussion on cpukit/include/dev/io/iodev.h: 
https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1243#note_151921

 > +   */
 > +  rtems_recursive_mutex mutex;
 > +};
 > +
 > +/**
 > + * @brief Allocate and initialize the iodev device.
 > + *
 > + * After a successful allocation and initialization of the iodev device
 > + * it must be destroyed via rtems_iodev_destroy_and_free().
 > + *
 > + * @param[in] size The number of bytes to allocate.
 > + *
 > + * @retval NULL Failed to set up iodev device.
 > + * @retval non-NULL The new iodev device.
 > + */
 > +rtems_iodev *rtems_iodev_alloc_and_init( size_t size );

The reason for having these combined is for devices that might use the API that 
have dynamic allocation needs, such as device discovery on a bus. Statically 
defined devices like Hard IP on a board might choose to have statically defined 
memory requiring just an init. It just makes it an easier API to use between 
both dynamic and static use cases. Happy to revisit naming to bring inline with 
wider RTEMS.

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


_______________________________________________
bugs mailing list
[email protected]
http://lists.rtems.org/mailman/listinfo/bugs

Reply via email to