These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / net / ieee802154 / core.c
index 2ee00e8..c35fdfa 100644 (file)
@@ -95,6 +95,18 @@ cfg802154_rdev_by_wpan_phy_idx(int wpan_phy_idx)
        return result;
 }
 
+struct wpan_phy *wpan_phy_idx_to_wpan_phy(int wpan_phy_idx)
+{
+       struct cfg802154_registered_device *rdev;
+
+       ASSERT_RTNL();
+
+       rdev = cfg802154_rdev_by_wpan_phy_idx(wpan_phy_idx);
+       if (!rdev)
+               return NULL;
+       return &rdev->wpan_phy;
+}
+
 struct wpan_phy *
 wpan_phy_new(const struct cfg802154_ops *ops, size_t priv_size)
 {
@@ -121,8 +133,6 @@ wpan_phy_new(const struct cfg802154_ops *ops, size_t priv_size)
        /* atomic_inc_return makes it start at 1, make it start at 0 */
        rdev->wpan_phy_idx--;
 
-       mutex_init(&rdev->wpan_phy.pib_lock);
-
        INIT_LIST_HEAD(&rdev->wpan_dev_list);
        device_initialize(&rdev->wpan_phy.dev);
        dev_set_name(&rdev->wpan_phy.dev, PHY_NAME "%d", rdev->wpan_phy_idx);