Skip to content

Commit b4f7825

Browse files
glneoandersson
authored andcommitted
rpmsg: use module_rpmsg_driver in existing drivers and examples
Existing drivers and examples are updated to use the module_rpmsg_driver helper macro. Signed-off-by: Andrew F. Davis <afd@ti.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
1 parent f3d9f1c commit b4f7825

2 files changed

Lines changed: 2 additions & 24 deletions

File tree

‎Documentation/rpmsg.txt‎

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -254,18 +254,7 @@ static struct rpmsg_driver rpmsg_sample_client = {
254254
.callback = rpmsg_sample_cb,
255255
.remove = rpmsg_sample_remove,
256256
};
257-
258-
static int __init init(void)
259-
{
260-
return register_rpmsg_driver(&rpmsg_sample_client);
261-
}
262-
module_init(init);
263-
264-
static void __exit fini(void)
265-
{
266-
unregister_rpmsg_driver(&rpmsg_sample_client);
267-
}
268-
module_exit(fini);
257+
module_rpmsg_driver(rpmsg_sample_client);
269258

270259
Note: a similar sample which can be built and loaded can be found
271260
in samples/rpmsg/.

‎samples/rpmsg/rpmsg_client_sample.c‎

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -82,18 +82,7 @@ static struct rpmsg_driver rpmsg_sample_client = {
8282
.callback = rpmsg_sample_cb,
8383
.remove = rpmsg_sample_remove,
8484
};
85-
86-
static int __init rpmsg_client_sample_init(void)
87-
{
88-
return register_rpmsg_driver(&rpmsg_sample_client);
89-
}
90-
module_init(rpmsg_client_sample_init);
91-
92-
static void __exit rpmsg_client_sample_fini(void)
93-
{
94-
unregister_rpmsg_driver(&rpmsg_sample_client);
95-
}
96-
module_exit(rpmsg_client_sample_fini);
85+
module_rpmsg_driver(rpmsg_sample_client);
9786

9887
MODULE_DESCRIPTION("Remote processor messaging sample client driver");
9988
MODULE_LICENSE("GPL v2");

0 commit comments

Comments
 (0)