[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201222105726.16906-10-arnaud.pouliquen@foss.st.com>
Date: Tue, 22 Dec 2020 11:57:19 +0100
From: Arnaud Pouliquen <arnaud.pouliquen@...s.st.com>
To: Bjorn Andersson <bjorn.andersson@...aro.org>,
Ohad Ben-Cohen <ohad@...ery.com>,
Mathieu Poirier <mathieu.poirier@...aro.org>,
Andy Gross <agross@...nel.org>
CC: <linux-remoteproc@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-stm32@...md-mailman.stormreply.com>,
<linux-arm-msm@...r.kernel.org>, <arnaud.pouliquen@...s.st.com>
Subject: [PATCH v2 09/16] rpmsg: char: register RPMsg raw service to the ioctl interface.
Associate the RPMsg char to the RPMSG_RAW_SERVICE, by registering it to the
RPMsg Control.
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@...s.st.com>
---
drivers/rpmsg/rpmsg_char.c | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/drivers/rpmsg/rpmsg_char.c b/drivers/rpmsg/rpmsg_char.c
index 3d77f4d5fc32..66e01b979e72 100644
--- a/drivers/rpmsg/rpmsg_char.c
+++ b/drivers/rpmsg/rpmsg_char.c
@@ -394,6 +394,11 @@ static struct rpmsg_driver rpmsg_chrdev_driver = {
},
};
+const struct rpmsg_drv_ctrl_info rpmsg_chrdev_ctrl = {
+ .drv_name = "rpmsg_chrdev",
+ .service = RPMSG_RAW_SERVICE,
+};
+
static int rpmsg_chrdev_init(void)
{
int ret;
@@ -407,15 +412,27 @@ static int rpmsg_chrdev_init(void)
ret = register_rpmsg_driver(&rpmsg_chrdev_driver);
if (ret < 0) {
pr_err("rpmsg: failed to register rpmsg chrdev driver\n");
- unregister_chrdev_region(rpmsg_major, RPMSG_DEV_MAX);
+ goto free_region;
}
+ ret = rpmsg_ctrl_register_ctl(&rpmsg_chrdev_ctrl);
+ if (ret < 0)
+ goto free_rpmsg;
+
+ return 0;
+
+free_rpmsg:
+ unregister_rpmsg_driver(&rpmsg_chrdev_driver);
+free_region:
+ unregister_chrdev_region(rpmsg_major, RPMSG_DEV_MAX);
+
return ret;
}
postcore_initcall(rpmsg_chrdev_init);
static void rpmsg_chrdev_exit(void)
{
+ rpmsg_ctrl_unregister_ctl(&rpmsg_chrdev_ctrl);
unregister_rpmsg_driver(&rpmsg_chrdev_driver);
unregister_chrdev_region(rpmsg_major, RPMSG_DEV_MAX);
}
--
2.17.1
Powered by blists - more mailing lists