From a51982e7f7447f74ea7b50369103f234c9b1b63a Mon Sep 17 00:00:00 2001 From: Andrew Davis Date: Tue, 12 Mar 2024 12:25:03 -0500 Subject: [PATCH] rpmsg_virtio: Deprecate functions that duplicate virtio functions 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 --- lib/include/openamp/rpmsg_virtio.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/include/openamp/rpmsg_virtio.h b/lib/include/openamp/rpmsg_virtio.h index 704a36e62..92b6b5417 100644 --- a/lib/include/openamp/rpmsg_virtio.h +++ b/lib/include/openamp/rpmsg_virtio.h @@ -134,9 +134,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) { @@ -146,10 +149,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); @@ -158,10 +164,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) { @@ -171,11 +180,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) @@ -186,6 +198,8 @@ 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. @@ -193,6 +207,7 @@ rpmsg_virtio_read_config(struct rpmsg_virtio_device *rvdev, * * @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)