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 <afd@ti.com>
  • Loading branch information
glneo authored and arnopo committed Apr 9, 2024
1 parent 9905d67 commit 2807e64
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/rpmsg/rpmsg_virtio.c
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,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 @@ -667,7 +667,7 @@ static int rpmsg_virtio_ns_callback(struct rpmsg_endpoint *ept, void *data,
bool ept_to_release;
char name[RPMSG_NAME_SIZE];

(void)priv;
(void)ept;
(void)src;

ns_msg = data;
Expand Down Expand Up @@ -991,7 +991,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, NULL);
rpmsg_virtio_ns_callback, NULL, rvdev);
}

#ifndef VIRTIO_DEVICE_ONLY
Expand Down

0 comments on commit 2807e64

Please sign in to comment.