summaryrefslogtreecommitdiff
path: root/drivers/rpmsg/virtio_rpmsg_bus.c
diff options
context:
space:
mode:
authorBjorn Andersson <bjorn.andersson@linaro.org>2016-09-02 01:27:55 +0300
committerBjorn Andersson <bjorn.andersson@linaro.org>2016-09-09 08:15:19 +0300
commit2a48d7322dc88f1bc6c8bd9e087fc6341ba659fd (patch)
tree5e7f22bdf638a51576523e631589d52cdadf3012 /drivers/rpmsg/virtio_rpmsg_bus.c
parent4dffed5b3ac796bcaf040ca1f64e650f9263363e (diff)
downloadlinux-2a48d7322dc88f1bc6c8bd9e087fc6341ba659fd.tar.xz
rpmsg: rpmsg_send() operations takes rpmsg_endpoint
The rpmsg_send() operations has been taking a rpmsg_device, but this forces users of secondary rpmsg_endpoints to use the rpmsg_sendto() interface - by extracting source and destination from the given data structures. If we instead pass the rpmsg_endpoint to these functions a service can use rpmsg_sendto() to respond to messages, even on secondary endpoints. In addition this would allow us to support operations on multiple channels in future backends that does not support off-channel operations. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Diffstat (limited to 'drivers/rpmsg/virtio_rpmsg_bus.c')
-rw-r--r--drivers/rpmsg/virtio_rpmsg_bus.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c
index c4bd89ea7681..345036b485d7 100644
--- a/drivers/rpmsg/virtio_rpmsg_bus.c
+++ b/drivers/rpmsg/virtio_rpmsg_bus.c
@@ -379,10 +379,10 @@ static int rpmsg_dev_probe(struct device *dev)
struct rpmsg_ns_msg nsm;
strncpy(nsm.name, rpdev->id.name, RPMSG_NAME_SIZE);
- nsm.addr = rpdev->src;
+ nsm.addr = rpdev->ept->addr;
nsm.flags = RPMSG_NS_CREATE;
- err = rpmsg_sendto(rpdev, &nsm, sizeof(nsm), RPMSG_NS_ADDR);
+ err = rpmsg_sendto(rpdev->ept, &nsm, sizeof(nsm), RPMSG_NS_ADDR);
if (err)
dev_err(dev, "failed to announce service %d\n", err);
}
@@ -407,7 +407,7 @@ static int rpmsg_dev_remove(struct device *dev)
nsm.addr = rpdev->src;
nsm.flags = RPMSG_NS_DESTROY;
- err = rpmsg_sendto(rpdev, &nsm, sizeof(nsm), RPMSG_NS_ADDR);
+ err = rpmsg_sendto(rpdev->ept, &nsm, sizeof(nsm), RPMSG_NS_ADDR);
if (err)
dev_err(dev, "failed to announce service %d\n", err);
}