From: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Sergey Lapin <slapin@ossfans.org>
Subject: [PATCH 06/17] wpan-phy: follow usual patter of devices registration
Date: Fri, 6 Nov 2009 15:39:30 +0300 [thread overview]
Message-ID: <1257511181-19403-7-git-send-email-dbaryshkov@gmail.com> (raw)
In-Reply-To: <1257511181-19403-1-git-send-email-dbaryshkov@gmail.com>
Follow the usual pattern of devices registration by adding new function
(wpan_phy_set_dev) that sets child->parent relationship and removing
parent argument from wpan_phy_register call.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
drivers/ieee802154/fakehard.c | 3 ++-
include/net/wpan-phy.h | 6 +++++-
net/ieee802154/wpan-class.c | 4 +---
3 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/ieee802154/fakehard.c b/drivers/ieee802154/fakehard.c
index f6f2afe..4ea93cc 100644
--- a/drivers/ieee802154/fakehard.c
+++ b/drivers/ieee802154/fakehard.c
@@ -372,11 +372,12 @@ static int __devinit ieee802154fake_probe(struct platform_device *pdev)
goto out;
}
+ wpan_phy_set_dev(phy, &pdev->dev);
SET_NETDEV_DEV(dev, &phy->dev);
platform_set_drvdata(pdev, dev);
- err = wpan_phy_register(&pdev->dev, phy);
+ err = wpan_phy_register(phy);
if (err)
goto out;
diff --git a/include/net/wpan-phy.h b/include/net/wpan-phy.h
index 7b7fc58..f63537c 100644
--- a/include/net/wpan-phy.h
+++ b/include/net/wpan-phy.h
@@ -45,7 +45,11 @@ struct wpan_phy {
};
struct wpan_phy *wpan_phy_alloc(size_t priv_size);
-int wpan_phy_register(struct device *parent, struct wpan_phy *phy);
+static inline void wpan_phy_set_dev(struct wpan_phy *phy, struct device *dev)
+{
+ phy->dev.parent = dev;
+}
+int wpan_phy_register(struct wpan_phy *phy);
void wpan_phy_unregister(struct wpan_phy *phy);
void wpan_phy_free(struct wpan_phy *phy);
/* Same semantics as for class_for_each_device */
diff --git a/net/ieee802154/wpan-class.c b/net/ieee802154/wpan-class.c
index 0c51f85..cd42e88 100644
--- a/net/ieee802154/wpan-class.c
+++ b/net/ieee802154/wpan-class.c
@@ -168,10 +168,8 @@ struct wpan_phy *wpan_phy_alloc(size_t priv_size)
}
EXPORT_SYMBOL(wpan_phy_alloc);
-int wpan_phy_register(struct device *parent, struct wpan_phy *phy)
+int wpan_phy_register(struct wpan_phy *phy)
{
- phy->dev.parent = parent;
-
return device_add(&phy->dev);
}
EXPORT_SYMBOL(wpan_phy_register);
--
1.6.5
next prev parent reply other threads:[~2009-11-06 12:40 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-06 12:39 [NEXT PULL 00/17] IEEE 802.15.4 stack updates Dmitry Eremin-Solenikov
2009-11-06 12:39 ` [PATCH 01/17] wpan-phy: add a helper to put the wpan_phy device Dmitry Eremin-Solenikov
2009-11-06 12:39 ` [PATCH 02/17] wpan-phy: add wpan-phy iteration functions Dmitry Eremin-Solenikov
2009-11-06 12:39 ` [PATCH 03/17] wpan-phy: init channel/page fields Dmitry Eremin-Solenikov
2009-11-06 12:39 ` [PATCH 04/17] wpan-phy: use snprintf to limit the amount of chars written Dmitry Eremin-Solenikov
2009-11-06 12:39 ` [PATCH 05/17] wpan-phy: allow specifying a per-page channel mask Dmitry Eremin-Solenikov
2009-11-06 12:39 ` Dmitry Eremin-Solenikov [this message]
2009-11-06 12:39 ` [PATCH 07/17] ieee802154: constify struct net_device in some operations Dmitry Eremin-Solenikov
2009-11-06 12:39 ` [PATCH 08/17] ieee802154: merge nl802154 and wpan-class in single module Dmitry Eremin-Solenikov
2009-11-06 12:39 ` [PATCH 09/17] ieee802154: split away MAC commands implementation Dmitry Eremin-Solenikov
2009-11-06 12:39 ` [PATCH 10/17] ieee802154: add LIST_PHY command support Dmitry Eremin-Solenikov
2009-11-06 12:39 ` [PATCH 11/17] fakehard: no need to export net_to_phy, make it static Dmitry Eremin-Solenikov
2009-11-06 12:39 ` [PATCH 12/17] fakehard: claim all 2.4 Ghz channels as supported Dmitry Eremin-Solenikov
2009-11-06 12:39 ` [PATCH 13/17] ieee802154: add an mlme_ops call to retrieve PHY object Dmitry Eremin-Solenikov
2009-11-06 12:39 ` [PATCH 14/17] fakehard: mlme_ops->get_phy implementation Dmitry Eremin-Solenikov
2009-11-06 12:39 ` [PATCH 15/17] ieee802154: add two nl802154 helpers Dmitry Eremin-Solenikov
2009-11-06 12:39 ` [PATCH 16/17] ieee802154: add PHY_NAME to LIST_IFACE command results Dmitry Eremin-Solenikov
2009-11-06 12:39 ` [PATCH 17/17] ieee802154: add support for creation/removal of logic interfaces Dmitry Eremin-Solenikov
2009-11-07 2:02 ` [NEXT PULL 00/17] IEEE 802.15.4 stack 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=1257511181-19403-7-git-send-email-dbaryshkov@gmail.com \
--to=dbaryshkov@gmail.com \
--cc=davem@davemloft.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).