From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755484AbcEDSeV (ORCPT ); Wed, 4 May 2016 14:34:21 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:52784 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753535AbcEDSeS (ORCPT ); Wed, 4 May 2016 14:34:18 -0400 From: "Andrew F. Davis" To: Ohad Ben-Cohen , Bjorn Andersson , Jonathan Corbet , Suman Anna CC: , , , "Andrew F . Davis" Subject: [PATCH 4/4] rpmsg: use module_rpmsg_driver in existing drivers and examples Date: Wed, 4 May 2016 13:34:15 -0500 Message-ID: <1462386855-17381-4-git-send-email-afd@ti.com> X-Mailer: git-send-email 2.8.2 In-Reply-To: <1462386855-17381-1-git-send-email-afd@ti.com> References: <1462386855-17381-1-git-send-email-afd@ti.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Existing drivers and examples are updated to use the module_rpmsg_driver helper macro. Signed-off-by: Andrew F. Davis --- Documentation/rpmsg.txt | 14 +------------- samples/rpmsg/rpmsg_client_sample.c | 13 +------------ 2 files changed, 2 insertions(+), 25 deletions(-) diff --git a/Documentation/rpmsg.txt b/Documentation/rpmsg.txt index 1d88426..b19700c 100644 --- a/Documentation/rpmsg.txt +++ b/Documentation/rpmsg.txt @@ -202,7 +202,6 @@ with the payload of the inbound message). a pointer to a previously-registered rpmsg_driver struct. Returns 0 on success, and an appropriate error value on failure. - 3. Typical usage The following is a simple rpmsg driver, that sends an "hello!" message @@ -254,18 +253,7 @@ static struct rpmsg_driver rpmsg_sample_client = { .callback = rpmsg_sample_cb, .remove = rpmsg_sample_remove, }; - -static int __init init(void) -{ - return register_rpmsg_driver(&rpmsg_sample_client); -} -module_init(init); - -static void __exit fini(void) -{ - unregister_rpmsg_driver(&rpmsg_sample_client); -} -module_exit(fini); +module_rpmsg_driver(rpmsg_sample_client); Note: a similar sample which can be built and loaded can be found in samples/rpmsg/. diff --git a/samples/rpmsg/rpmsg_client_sample.c b/samples/rpmsg/rpmsg_client_sample.c index 82ed288..d0e249c9 100644 --- a/samples/rpmsg/rpmsg_client_sample.c +++ b/samples/rpmsg/rpmsg_client_sample.c @@ -82,18 +82,7 @@ static struct rpmsg_driver rpmsg_sample_client = { .callback = rpmsg_sample_cb, .remove = rpmsg_sample_remove, }; - -static int __init rpmsg_client_sample_init(void) -{ - return register_rpmsg_driver(&rpmsg_sample_client); -} -module_init(rpmsg_client_sample_init); - -static void __exit rpmsg_client_sample_fini(void) -{ - unregister_rpmsg_driver(&rpmsg_sample_client); -} -module_exit(rpmsg_client_sample_fini); +module_rpmsg_driver(rpmsg_sample_client); MODULE_DESCRIPTION("Remote processor messaging sample client driver"); MODULE_LICENSE("GPL v2"); -- 2.8.2