From: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: linux-zigbee-devel@lists.sourceforge.net,
Sergey Lapin <slapin@ossfans.org>,
netdev@vger.kernel.org
Subject: [PATCH 5/7] ieee802154: merge nl802154 and wpan-class in single module
Date: Wed, 16 Sep 2009 02:13:03 +0400 [thread overview]
Message-ID: <1253052785-26190-6-git-send-email-dbaryshkov@gmail.com> (raw)
In-Reply-To: <1253052785-26190-5-git-send-email-dbaryshkov@gmail.com>
There is no real need to have ieee802154 interfaces separate
into several small modules, as neither of them has it's own use.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
net/ieee802154/Makefile | 4 ++--
net/ieee802154/netlink.c | 9 ++-------
net/ieee802154/wpan-class.c | 23 ++++++++++++++++++++---
3 files changed, 24 insertions(+), 12 deletions(-)
diff --git a/net/ieee802154/Makefile b/net/ieee802154/Makefile
index 4068a9f..42b1f0d 100644
--- a/net/ieee802154/Makefile
+++ b/net/ieee802154/Makefile
@@ -1,5 +1,5 @@
-obj-$(CONFIG_IEEE802154) += nl802154.o af_802154.o wpan-class.o
-nl802154-y := netlink.o nl_policy.o
+obj-$(CONFIG_IEEE802154) += ieee802154.o af_802154.o
+ieee802154-y := netlink.o nl_policy.o wpan-class.o
af_802154-y := af_ieee802154.o raw.o dgram.o
ccflags-y += -Wall -DDEBUG
diff --git a/net/ieee802154/netlink.c b/net/ieee802154/netlink.c
index ca767bd..0fadd6b 100644
--- a/net/ieee802154/netlink.c
+++ b/net/ieee802154/netlink.c
@@ -643,7 +643,7 @@ static struct genl_ops ieee802154_coordinator_ops[] = {
ieee802154_dump_iface),
};
-static int __init ieee802154_nl_init(void)
+int __init ieee802154_nl_init(void)
{
int rc;
int i;
@@ -676,14 +676,9 @@ fail:
genl_unregister_family(&ieee802154_coordinator_family);
return rc;
}
-module_init(ieee802154_nl_init);
-static void __exit ieee802154_nl_exit(void)
+void __exit ieee802154_nl_exit(void)
{
genl_unregister_family(&ieee802154_coordinator_family);
}
-module_exit(ieee802154_nl_exit);
-
-MODULE_LICENSE("GPL v2");
-MODULE_DESCRIPTION("ieee 802.15.4 configuration interface");
diff --git a/net/ieee802154/wpan-class.c b/net/ieee802154/wpan-class.c
index 0cec138..f8479c6 100644
--- a/net/ieee802154/wpan-class.c
+++ b/net/ieee802154/wpan-class.c
@@ -22,6 +22,8 @@
#include <net/wpan-phy.h>
+#include "ieee802154.h"
+
#define MASTER_SHOW_COMPLEX(name, format_string, args...) \
static ssize_t name ## _show(struct device *dev, \
struct device_attribute *attr, char *buf) \
@@ -169,16 +171,31 @@ EXPORT_SYMBOL(wpan_phy_free);
static int __init wpan_phy_class_init(void)
{
- return class_register(&wpan_phy_class);
+ int rc;
+ rc = class_register(&wpan_phy_class);
+ if (rc)
+ goto err;
+
+ rc = ieee802154_nl_init();
+ if (rc)
+ goto err_nl;
+
+ return 0;
+err_nl:
+ class_unregister(&wpan_phy_class);
+err:
+ return rc;
}
-subsys_initcall(wpan_phy_class_init);
+module_init(wpan_phy_class_init);
static void __exit wpan_phy_class_exit(void)
{
+ ieee802154_nl_exit();
class_unregister(&wpan_phy_class);
}
module_exit(wpan_phy_class_exit);
-MODULE_DESCRIPTION("IEEE 802.15.4 device class");
MODULE_LICENSE("GPL v2");
+MODULE_DESCRIPTION("IEEE 802.15.4 configuration interface");
+MODULE_AUTHOR("Dmitry Eremin-Solenikov");
--
1.6.3.3
next prev parent reply other threads:[~2009-09-15 22:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-15 22:12 [GIT PULL 0/7] Small IEEE 802.15.4 updates Dmitry Eremin-Solenikov
2009-09-15 22:12 ` [PATCH 1/7] af_ieee802154: setsockopt optlen arg isn't __user Dmitry Eremin-Solenikov
2009-09-15 22:13 ` [PATCH 2/7] ieee802154: add locking for seq numbers Dmitry Eremin-Solenikov
2009-09-15 22:13 ` [PATCH 3/7] ieee802154: add a helper to put the wpan_phy device Dmitry Eremin-Solenikov
2009-09-15 22:13 ` [PATCH 4/7] ieee802154: add wpan-phy iteration functions Dmitry Eremin-Solenikov
2009-09-15 22:13 ` Dmitry Eremin-Solenikov [this message]
2009-09-15 22:13 ` [PATCH 6/7] nl802154: split away MAC commands implementation Dmitry Eremin-Solenikov
2009-09-15 22:13 ` [PATCH 7/7] ieee802154: add LIST_PHY command support Dmitry Eremin-Solenikov
2009-09-16 6:44 ` [GIT PULL 0/7] Small IEEE 802.15.4 updates David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1253052785-26190-6-git-send-email-dbaryshkov@gmail.com \
--to=dbaryshkov@gmail.com \
--cc=davem@davemloft.net \
--cc=linux-zigbee-devel@lists.sourceforge.net \
--cc=netdev@vger.kernel.org \
--cc=slapin@ossfans.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).