From patchwork Tue Sep 15 22:13:03 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 33675 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 844D9B7B93 for ; Wed, 16 Sep 2009 08:14:18 +1000 (EST) Received: by ozlabs.org (Postfix) id 70425DDD1B; Wed, 16 Sep 2009 08:14:18 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 1B166DDD0C for ; Wed, 16 Sep 2009 08:14:18 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758735AbZIOWOJ (ORCPT ); Tue, 15 Sep 2009 18:14:09 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751917AbZIOWOH (ORCPT ); Tue, 15 Sep 2009 18:14:07 -0400 Received: from mail-ew0-f206.google.com ([209.85.219.206]:63125 "EHLO mail-ew0-f206.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758713AbZIOWOC (ORCPT ); Tue, 15 Sep 2009 18:14:02 -0400 Received: by mail-ew0-f206.google.com with SMTP id 2so922640ewy.17 for ; Tue, 15 Sep 2009 15:14:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references; bh=WUtHXXY3adZl8m1Mi3NoGP/F3Mo9jQhnjHT2HGQAZ+k=; b=ixOmx9kjVPbZNIuHyOi03EUcXCI0UbgIavksjHB7WH+e7dhZMRZTYIgJOnz1XI3gdD h+nQNSA/bla5N/A3jbn/hmgWcnPIkG3dFMeML9lfLokc1FNisF0lkAoSRVyG9iQAcB1l oG3c1QynIVjTU25HlmUGW6owTuhGAG8qGX2vo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=I4JcpI3zAyUoVFu/VICeCjsTIpB0s0VVnjUjCMf34Sc+AG/sT5uW86y0Tp1Px5CYgt nj0d3+ODC4MV+s2cGpkOiokkbfFVSP9LxuG5v+B3VwuS9fMVFPrZyxCuiD4ENOPr9XcC AbsahMmDZ8WX9aONwJ5GG6DSsgJfaBUIcIAL0= Received: by 10.211.132.22 with SMTP id j22mr1495024ebn.24.1253052845722; Tue, 15 Sep 2009 15:14:05 -0700 (PDT) Received: from localhost.localdomain (ppp91-122-8-155.pppoe.avangarddsl.ru [91.122.8.155]) by mx.google.com with ESMTPS id 7sm381518eyb.37.2009.09.15.15.14.03 (version=SSLv3 cipher=RC4-MD5); Tue, 15 Sep 2009 15:14:05 -0700 (PDT) From: Dmitry Eremin-Solenikov To: "David S. Miller" Cc: linux-zigbee-devel@lists.sourceforge.net, Sergey Lapin , 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 Message-Id: <1253052785-26190-6-git-send-email-dbaryshkov@gmail.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1253052785-26190-5-git-send-email-dbaryshkov@gmail.com> References: <1253052785-26190-1-git-send-email-dbaryshkov@gmail.com> <1253052785-26190-2-git-send-email-dbaryshkov@gmail.com> <1253052785-26190-3-git-send-email-dbaryshkov@gmail.com> <1253052785-26190-4-git-send-email-dbaryshkov@gmail.com> <1253052785-26190-5-git-send-email-dbaryshkov@gmail.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 --- 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 +#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");