diff options
author | Arnaud Pouliquen <arnaud.pouliquen@foss.st.com> | 2022-01-24 11:25:15 +0100 |
---|---|---|
committer | Bjorn Andersson <bjorn.andersson@linaro.org> | 2022-03-13 17:49:53 +0100 |
commit | 608edd96049b142de7944413cd7c24cb3f203d37 (patch) | |
tree | c4d3db180e4ad34bea8cfd4f6cd6c3c7b5f92f00 /drivers/rpmsg/rpmsg_char.c | |
parent | rpmsg: char: Export eptdev create and destroy functions (diff) | |
download | linux-608edd96049b142de7944413cd7c24cb3f203d37.tar.xz linux-608edd96049b142de7944413cd7c24cb3f203d37.zip |
rpmsg: Create the rpmsg class in core instead of in rpmsg char
Migrate the creation of the rpmsg class from the rpmsg_char
to the core that the class is usable by the rpmsg_char and
the future rpmsg_ctrl module.
Suggested-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20220124102524.295783-3-arnaud.pouliquen@foss.st.com
Diffstat (limited to 'drivers/rpmsg/rpmsg_char.c')
-rw-r--r-- | drivers/rpmsg/rpmsg_char.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/rpmsg/rpmsg_char.c b/drivers/rpmsg/rpmsg_char.c index acb62b7d1db1..0ca88935da8f 100644 --- a/drivers/rpmsg/rpmsg_char.c +++ b/drivers/rpmsg/rpmsg_char.c @@ -27,11 +27,11 @@ #include <uapi/linux/rpmsg.h> #include "rpmsg_char.h" +#include "rpmsg_internal.h" #define RPMSG_DEV_MAX (MINORMASK + 1) static dev_t rpmsg_major; -static struct class *rpmsg_class; static DEFINE_IDA(rpmsg_ctrl_ida); static DEFINE_IDA(rpmsg_ept_ida); @@ -550,17 +550,9 @@ static int rpmsg_chrdev_init(void) return ret; } - rpmsg_class = class_create(THIS_MODULE, "rpmsg"); - if (IS_ERR(rpmsg_class)) { - pr_err("failed to create rpmsg class\n"); - unregister_chrdev_region(rpmsg_major, RPMSG_DEV_MAX); - return PTR_ERR(rpmsg_class); - } - ret = register_rpmsg_driver(&rpmsg_chrdev_driver); if (ret < 0) { pr_err("failed to register rpmsg driver\n"); - class_destroy(rpmsg_class); unregister_chrdev_region(rpmsg_major, RPMSG_DEV_MAX); } @@ -571,7 +563,6 @@ postcore_initcall(rpmsg_chrdev_init); static void rpmsg_chrdev_exit(void) { unregister_rpmsg_driver(&rpmsg_chrdev_driver); - class_destroy(rpmsg_class); unregister_chrdev_region(rpmsg_major, RPMSG_DEV_MAX); } module_exit(rpmsg_chrdev_exit); |