nl80211: move "can set channel" check
[deliverable/linux.git] / net / wireless / nl80211.c
index 5d3167d71b5fb2a3f44fb676959b11343b17079b..879ca620fd6fba193cfeb96cfeba157b054bf993 100644 (file)
@@ -1516,10 +1516,8 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
                result = 0;
 
                mutex_lock(&rdev->mtx);
-       } else if (nl80211_can_set_dev_channel(netdev->ieee80211_ptr))
+       } else
                wdev = netdev->ieee80211_ptr;
-       else
-               wdev = NULL;
 
        /*
         * end workaround code, by now the rdev is available
@@ -1579,7 +1577,9 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
        }
 
        if (info->attrs[NL80211_ATTR_WIPHY_FREQ]) {
-               result = __nl80211_set_channel(rdev, wdev, info);
+               result = __nl80211_set_channel(rdev,
+                               nl80211_can_set_dev_channel(wdev) ? wdev : NULL,
+                               info);
                if (result)
                        goto bad_res;
        }
@@ -6932,7 +6932,7 @@ static int nl80211_start_p2p_device(struct sk_buff *skb, struct genl_info *info)
        if (err)
                return err;
 
-       err = rdev->ops->start_p2p_device(&rdev->wiphy, wdev);
+       err = rdev_start_p2p_device(rdev, wdev);
        if (err)
                return err;
 
@@ -6958,7 +6958,7 @@ static int nl80211_stop_p2p_device(struct sk_buff *skb, struct genl_info *info)
        if (!wdev->p2p_started)
                return 0;
 
-       rdev->ops->stop_p2p_device(&rdev->wiphy, wdev);
+       rdev_stop_p2p_device(rdev, wdev);
        wdev->p2p_started = false;
 
        mutex_lock(&rdev->devlist_mtx);
This page took 0.025633 seconds and 5 git commands to generate.