mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-03-01 13:57:57 +07:00
wpan-phy: follow usual patter of devices registration
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>
This commit is contained in:
parent
a0b4a738e0
commit
e9cf356c0c
@ -372,11 +372,12 @@ static int __devinit ieee802154fake_probe(struct platform_device *pdev)
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wpan_phy_set_dev(phy, &pdev->dev);
|
||||||
SET_NETDEV_DEV(dev, &phy->dev);
|
SET_NETDEV_DEV(dev, &phy->dev);
|
||||||
|
|
||||||
platform_set_drvdata(pdev, dev);
|
platform_set_drvdata(pdev, dev);
|
||||||
|
|
||||||
err = wpan_phy_register(&pdev->dev, phy);
|
err = wpan_phy_register(phy);
|
||||||
if (err)
|
if (err)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
@ -45,7 +45,11 @@ struct wpan_phy {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct wpan_phy *wpan_phy_alloc(size_t priv_size);
|
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_unregister(struct wpan_phy *phy);
|
||||||
void wpan_phy_free(struct wpan_phy *phy);
|
void wpan_phy_free(struct wpan_phy *phy);
|
||||||
/* Same semantics as for class_for_each_device */
|
/* Same semantics as for class_for_each_device */
|
||||||
|
@ -168,10 +168,8 @@ struct wpan_phy *wpan_phy_alloc(size_t priv_size)
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL(wpan_phy_alloc);
|
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);
|
return device_add(&phy->dev);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(wpan_phy_register);
|
EXPORT_SYMBOL(wpan_phy_register);
|
||||||
|
Loading…
Reference in New Issue
Block a user