[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200731121043.24199-4-arnaud.pouliquen@st.com>
Date: Fri, 31 Jul 2020 14:10:33 +0200
From: Arnaud Pouliquen <arnaud.pouliquen@...com>
To: Bjorn Andersson <bjorn.andersson@...aro.org>,
Ohad Ben-Cohen <ohad@...ery.com>,
Mathieu Poirier <mathieu.poirier@...aro.org>
CC: <linux-remoteproc@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-stm32@...md-mailman.stormreply.com>,
<arnaud.pouliquen@...com>
Subject: [PATCH 03/13] rpmsg: add helper to create the rpmsg ctrl device
This function creates the rpmsg_ctl device using the
driver_override to link device to the driver.
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@...com>
---
drivers/rpmsg/rpmsg_internal.h | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/drivers/rpmsg/rpmsg_internal.h b/drivers/rpmsg/rpmsg_internal.h
index d1549e5cb607..811d6e27a720 100644
--- a/drivers/rpmsg/rpmsg_internal.h
+++ b/drivers/rpmsg/rpmsg_internal.h
@@ -119,6 +119,21 @@ static inline int rpmsg_ns_register_device(struct rpmsg_device *rpdev)
return rpmsg_register_device(rpdev);
}
+/**
+ * rpmsg_ctl_register_device() - register control device based on rpdev
+ * @rpdev: prepared rpdev to be used for creating endpoints
+ *
+ * This function wraps rpmsg_register_device() preparing the rpdev for use as
+ * a control rpmsg driver forcing the channel name.
+ */
+static inline int rpmsg_ctl_register_device(struct rpmsg_device *rpdev)
+{
+ strcpy(rpdev->id.name, "rpmsg_ctrl");
+ rpdev->driver_override = "rpmsg_ctrl";
+
+ return rpmsg_register_device(rpdev);
+}
+
int rpmsg_ns_announce_create(struct rpmsg_device *rpdev);
int rpmsg_ns_announce_destroy(struct rpmsg_device *rpdev);
--
2.17.1
Powered by blists - more mailing lists