Skip to content

Commit

Permalink
rpmsg_virtio: Use priv data in name service callback
Browse files Browse the repository at this point in the history
The callback allows us to add private data. Use that to store our
rpmsg_device instance instead of extracting it from the endpoint
struct. The contents of that struct are internal to the RPMsg layer.

Signed-off-by: Andrew Davis <[email protected]>
  • Loading branch information
glneo committed Mar 15, 2024
1 parent d9c21e1 commit c3ade57
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/rpmsg/rpmsg_virtio.c
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ static void rpmsg_virtio_rx_callback(struct virtqueue *vq)
static int rpmsg_virtio_ns_callback(struct rpmsg_endpoint *ept, void *data,
size_t len, uint32_t src, void *priv)
{
struct rpmsg_device *rdev = ept->rdev;
struct rpmsg_device *rdev = priv;
struct rpmsg_virtio_device *rvdev = metal_container_of(rdev,
struct rpmsg_virtio_device,
rdev);
Expand All @@ -649,7 +649,6 @@ static int rpmsg_virtio_ns_callback(struct rpmsg_endpoint *ept, void *data,
bool ept_to_release;
char name[RPMSG_NAME_SIZE];

(void)priv;
(void)src;

ns_msg = data;
Expand Down Expand Up @@ -966,7 +965,7 @@ int rpmsg_init_vdev_with_config(struct rpmsg_virtio_device *rvdev,
if (rdev->support_ns) {
rpmsg_register_endpoint(rdev, &rdev->ns_ept, "NS",
RPMSG_NS_EPT_ADDR, RPMSG_NS_EPT_ADDR,
rpmsg_virtio_ns_callback, NULL);
rpmsg_virtio_ns_callback, rvdev);
}

#ifndef VIRTIO_DEVICE_ONLY
Expand Down

0 comments on commit c3ade57

Please sign in to comment.