Skip to content

Commit

Permalink
rpmsg_virtio: Deprecate functions that duplicate virtio functions
Browse files Browse the repository at this point in the history
Do not expose new functions that reach into structs not belonging to
rpmsg_virtio, that breaks layering. Functions to access these members of
struct virtio are already provided by virtio, use those instead. Deprecate
the unneeded and layer breaking rpmsg_virtio functions for the same.

Signed-off-by: Andrew Davis <afd@ti.com>
  • Loading branch information
glneo authored and arnopo committed Apr 2, 2024
1 parent 435a741 commit d233fdc
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/include/openamp/rpmsg_virtio.h
Expand Up @@ -143,9 +143,12 @@ rpmsg_virtio_get_role(struct rpmsg_virtio_device *rvdev)
/**
* @brief Set rpmsg virtio device status.
*
* Deprecated: Use virtio_set_status() instead
*
* @param rvdev Pointer to rpmsg virtio device.
* @param status Value to be set as rpmsg virtio device status.
*/
__deprecated
static inline void rpmsg_virtio_set_status(struct rpmsg_virtio_device *rvdev,
uint8_t status)
{
Expand All @@ -155,10 +158,13 @@ static inline void rpmsg_virtio_set_status(struct rpmsg_virtio_device *rvdev,
/**
* @brief Retrieve rpmsg virtio device status.
*
* Deprecated: Use virtio_get_status() instead
*
* @param rvdev Pointer to rpmsg virtio device.
*
* @return The rpmsg virtio device status.
*/
__deprecated
static inline uint8_t rpmsg_virtio_get_status(struct rpmsg_virtio_device *rvdev)
{
return rvdev->vdev->func->get_status(rvdev->vdev);
Expand All @@ -167,10 +173,13 @@ static inline uint8_t rpmsg_virtio_get_status(struct rpmsg_virtio_device *rvdev)
/**
* @brief Get the rpmsg virtio device features.
*
* Deprecated: Use virtio_get_features() instead
*
* @param rvdev Pointer to the rpmsg virtio device.
*
* @return The features supported by both the rpmsg driver and rpmsg device.
*/
__deprecated
static inline uint32_t
rpmsg_virtio_get_features(struct rpmsg_virtio_device *rvdev)
{
Expand All @@ -180,11 +189,14 @@ rpmsg_virtio_get_features(struct rpmsg_virtio_device *rvdev)
/**
* @brief Retrieve configuration data from the rpmsg virtio device.
*
* Deprecated: Use virtio_read_config() instead
*
* @param rvdev Pointer to the rpmsg virtio device.
* @param offset Offset of the data within the configuration area.
* @param dst Address of the buffer that will hold the data.
* @param length Length of the data to be retrieved.
*/
__deprecated
static inline void
rpmsg_virtio_read_config(struct rpmsg_virtio_device *rvdev,
uint32_t offset, void *dst, int length)
Expand All @@ -195,13 +207,16 @@ rpmsg_virtio_read_config(struct rpmsg_virtio_device *rvdev,
/**
* @brief Write configuration data to the rpmsg virtio device.
*
* Deprecated: Use virtio_write_config() instead
*
* @param rvdev Pointer to the rpmsg virtio device.
* @param offset Offset of the data within the configuration area.
* @param src Address of the buffer that holds the data to write.
* @param length Length of the data to be written.
*
* @return 0 on success, otherwise error code.
*/
__deprecated
static inline void
rpmsg_virtio_write_config(struct rpmsg_virtio_device *rvdev,
uint32_t offset, void *src, int length)
Expand Down

0 comments on commit d233fdc

Please sign in to comment.