]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/wireless/core.c
sh: struct device - replace bus_id with dev_name(), dev_set_name()
[linux-2.6-omap-h63xx.git] / net / wireless / core.c
index 5031db7b275b734b46870089765420c75c136d10..b96fc0c3f1c446132cf71e3e0464a6a2ff4edd84 100644 (file)
@@ -19,7 +19,6 @@
 #include "nl80211.h"
 #include "core.h"
 #include "sysfs.h"
-#include "reg.h"
 
 /* name for sysfs, %d is appended */
 #define PHY_NAME "phy"
@@ -236,8 +235,7 @@ struct wiphy *wiphy_new(struct cfg80211_ops *ops, int sizeof_priv)
        mutex_unlock(&cfg80211_drv_mutex);
 
        /* give it a proper name */
-       snprintf(drv->wiphy.dev.bus_id, BUS_ID_SIZE,
-                PHY_NAME "%d", drv->idx);
+       dev_set_name(&drv->wiphy.dev, PHY_NAME "%d", drv->idx);
 
        mutex_init(&drv->mtx);
        mutex_init(&drv->devlist_mtx);
@@ -301,12 +299,10 @@ int wiphy_register(struct wiphy *wiphy)
        /* check and set up bitrates */
        ieee80211_set_bitrate_flags(wiphy);
 
+       mutex_lock(&cfg80211_drv_mutex);
+
        /* set up regulatory info */
-       mutex_lock(&cfg80211_reg_mutex);
        wiphy_update_regulatory(wiphy, REGDOM_SET_BY_CORE);
-       mutex_unlock(&cfg80211_reg_mutex);
-
-       mutex_lock(&cfg80211_drv_mutex);
 
        res = device_add(&drv->wiphy.dev);
        if (res)
@@ -351,6 +347,10 @@ void wiphy_unregister(struct wiphy *wiphy)
        /* unlock again before freeing */
        mutex_unlock(&drv->mtx);
 
+       /* If this device got a regulatory hint tell core its
+        * free to listen now to a new shiny device regulatory hint */
+       reg_device_remove(wiphy);
+
        list_del(&drv->list);
        device_del(&drv->wiphy.dev);
        debugfs_remove(drv->wiphy.debugfsdir);