summaryrefslogtreecommitdiff
path: root/drivers/rpmsg/rpmsg_core.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-02-23 20:41:03 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2017-02-23 20:41:03 +0300
commit1db934a5b77a9e37c4742c704fde6af233187a98 (patch)
treea98c9ca4027e310d86270135fe57435bde897a24 /drivers/rpmsg/rpmsg_core.c
parenta3919caaa27a5fde1cbda46e394bb17953e104a1 (diff)
parentfa04b769f2832bf1aeb2e04b8865f6b688a752fd (diff)
downloadlinux-1db934a5b77a9e37c4742c704fde6af233187a98.tar.xz
Merge tag 'rpmsg-v4.11' of git://github.com/andersson/remoteproc
Pull rpmsg updates from Bjorn Andersson: "This introduces an interface for user space to directly communicate on rpmsg endpoints without the implementation of specific kernel drivers, which is useful for e.g. debug channels: * tag 'rpmsg-v4.11' of git://github.com/andersson/remoteproc: rpmsg: rpmsg_create_ept() returns NULL on error rpmsg: qcom: smd: Return positively when not enabled rpmsg: unlock on error in rpmsg_eptdev_read() rpmsg: char: add CONFIG_NET dependency rpmsg: smd: Register rpmsg user space interface for edges rpmsg: Driver for user space endpoint interface rpmsg: qcom_smd: Implement endpoint "poll" rpmsg: Introduce "poll" to endpoint ops rpmsg: qcom_smd: Add support for "label" property
Diffstat (limited to 'drivers/rpmsg/rpmsg_core.c')
-rw-r--r--drivers/rpmsg/rpmsg_core.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c
index 1cfb775e8e82..600f5f9f7431 100644
--- a/drivers/rpmsg/rpmsg_core.c
+++ b/drivers/rpmsg/rpmsg_core.c
@@ -72,7 +72,7 @@ struct rpmsg_endpoint *rpmsg_create_ept(struct rpmsg_device *rpdev,
struct rpmsg_channel_info chinfo)
{
if (WARN_ON(!rpdev))
- return ERR_PTR(-EINVAL);
+ return NULL;
return rpdev->ops->create_ept(rpdev, cb, priv, chinfo);
}
@@ -240,6 +240,26 @@ int rpmsg_trysendto(struct rpmsg_endpoint *ept, void *data, int len, u32 dst)
EXPORT_SYMBOL(rpmsg_trysendto);
/**
+ * rpmsg_poll() - poll the endpoint's send buffers
+ * @ept: the rpmsg endpoint
+ * @filp: file for poll_wait()
+ * @wait: poll_table for poll_wait()
+ *
+ * Returns mask representing the current state of the endpoint's send buffers
+ */
+unsigned int rpmsg_poll(struct rpmsg_endpoint *ept, struct file *filp,
+ poll_table *wait)
+{
+ if (WARN_ON(!ept))
+ return 0;
+ if (!ept->ops->poll)
+ return 0;
+
+ return ept->ops->poll(ept, filp, wait);
+}
+EXPORT_SYMBOL(rpmsg_poll);
+
+/**
* rpmsg_send_offchannel() - send a message using explicit src/dst addresses
* @ept: the rpmsg endpoint
* @src: source address