From 560a4cde9491b55968964880f069135b8a2926ef Mon Sep 17 00:00:00 2001 From: Dmitry Eremin-Solenikov Date: Mon, 28 Sep 2009 19:01:20 +0400 Subject: [PATCH] --- yaml --- r: 171257 b: refs/heads/master c: e9cf356c0c6b975fda84b15a5abdd1db88d74f84 h: refs/heads/master i: 171255: 47d4619de2be9161f173594a3005b6c97e3ff8e0 v: v3 --- [refs] | 2 +- trunk/drivers/ieee802154/fakehard.c | 3 ++- trunk/include/net/wpan-phy.h | 6 +++++- trunk/net/ieee802154/wpan-class.c | 4 +--- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index c3eb8605d95a..f05274889fa4 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a0b4a738e0e03f5e0d6ca366560f9a48e5adf83a +refs/heads/master: e9cf356c0c6b975fda84b15a5abdd1db88d74f84 diff --git a/trunk/drivers/ieee802154/fakehard.c b/trunk/drivers/ieee802154/fakehard.c index f6f2afefaa17..4ea93cc7afcc 100644 --- a/trunk/drivers/ieee802154/fakehard.c +++ b/trunk/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/trunk/include/net/wpan-phy.h b/trunk/include/net/wpan-phy.h index 7b7fc581e673..f63537c17363 100644 --- a/trunk/include/net/wpan-phy.h +++ b/trunk/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/trunk/net/ieee802154/wpan-class.c b/trunk/net/ieee802154/wpan-class.c index 0c51f85aa591..cd42e88b8397 100644 --- a/trunk/net/ieee802154/wpan-class.c +++ b/trunk/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);