diff options
-rw-r--r-- | drivers/ieee802154/fakehard.c | 3 | ||||
-rw-r--r-- | include/net/wpan-phy.h | 6 | ||||
-rw-r--r-- | 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 f6f2afefaa17..4ea93cc7afcc 100644 --- a/drivers/ieee802154/fakehard.c +++ b/drivers/ieee802154/fakehard.c | |||
@@ -372,11 +372,12 @@ static int __devinit ieee802154fake_probe(struct platform_device *pdev) | |||
372 | goto out; | 372 | goto out; |
373 | } | 373 | } |
374 | 374 | ||
375 | wpan_phy_set_dev(phy, &pdev->dev); | ||
375 | SET_NETDEV_DEV(dev, &phy->dev); | 376 | SET_NETDEV_DEV(dev, &phy->dev); |
376 | 377 | ||
377 | platform_set_drvdata(pdev, dev); | 378 | platform_set_drvdata(pdev, dev); |
378 | 379 | ||
379 | err = wpan_phy_register(&pdev->dev, phy); | 380 | err = wpan_phy_register(phy); |
380 | if (err) | 381 | if (err) |
381 | goto out; | 382 | goto out; |
382 | 383 | ||
diff --git a/include/net/wpan-phy.h b/include/net/wpan-phy.h index 7b7fc581e673..f63537c17363 100644 --- a/include/net/wpan-phy.h +++ b/include/net/wpan-phy.h | |||
@@ -45,7 +45,11 @@ struct wpan_phy { | |||
45 | }; | 45 | }; |
46 | 46 | ||
47 | struct wpan_phy *wpan_phy_alloc(size_t priv_size); | 47 | struct wpan_phy *wpan_phy_alloc(size_t priv_size); |
48 | int wpan_phy_register(struct device *parent, struct wpan_phy *phy); | 48 | static inline void wpan_phy_set_dev(struct wpan_phy *phy, struct device *dev) |
49 | { | ||
50 | phy->dev.parent = dev; | ||
51 | } | ||
52 | int wpan_phy_register(struct wpan_phy *phy); | ||
49 | void wpan_phy_unregister(struct wpan_phy *phy); | 53 | void wpan_phy_unregister(struct wpan_phy *phy); |
50 | void wpan_phy_free(struct wpan_phy *phy); | 54 | void wpan_phy_free(struct wpan_phy *phy); |
51 | /* Same semantics as for class_for_each_device */ | 55 | /* Same semantics as for class_for_each_device */ |
diff --git a/net/ieee802154/wpan-class.c b/net/ieee802154/wpan-class.c index 0c51f85aa591..cd42e88b8397 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) | |||
168 | } | 168 | } |
169 | EXPORT_SYMBOL(wpan_phy_alloc); | 169 | EXPORT_SYMBOL(wpan_phy_alloc); |
170 | 170 | ||
171 | int wpan_phy_register(struct device *parent, struct wpan_phy *phy) | 171 | int wpan_phy_register(struct wpan_phy *phy) |
172 | { | 172 | { |
173 | phy->dev.parent = parent; | ||
174 | |||
175 | return device_add(&phy->dev); | 173 | return device_add(&phy->dev); |
176 | } | 174 | } |
177 | EXPORT_SYMBOL(wpan_phy_register); | 175 | EXPORT_SYMBOL(wpan_phy_register); |