drivers/net/wireless/wl12xx: Use kmemdup
[pandora-wifi.git] / drivers / net / wireless / wl12xx / wl1251_main.c
index de59d8d..7d8ec43 100644 (file)
@@ -126,7 +126,7 @@ static int wl1251_fetch_nvs(struct wl1251 *wl)
        }
 
        wl->nvs_len = fw->size;
-       wl->nvs = kmalloc(wl->nvs_len, GFP_KERNEL);
+       wl->nvs = kmemdup(fw->data, wl->nvs_len, GFP_KERNEL);
 
        if (!wl->nvs) {
                wl1251_error("could not allocate memory for the nvs file");
@@ -134,8 +134,6 @@ static int wl1251_fetch_nvs(struct wl1251 *wl)
                goto out;
        }
 
-       memcpy(wl->nvs, fw->data, wl->nvs_len);
-
        ret = 0;
 
 out:
@@ -415,6 +413,7 @@ static int wl1251_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
 static int wl1251_op_start(struct ieee80211_hw *hw)
 {
        struct wl1251 *wl = hw->priv;
+       struct wiphy *wiphy = hw->wiphy;
        int ret = 0;
 
        wl1251_debug(DEBUG_MAC80211, "mac80211 start");
@@ -448,6 +447,10 @@ static int wl1251_op_start(struct ieee80211_hw *hw)
 
        wl1251_info("firmware booted (%s)", wl->fw_ver);
 
+       /* update hw/fw version info in wiphy struct */
+       wiphy->hw_version = wl->chip_id;
+       strncpy(wiphy->fw_version, wl->fw_ver, sizeof(wiphy->fw_version));
+
 out:
        if (ret < 0)
                wl1251_power_off(wl);
@@ -1421,5 +1424,4 @@ EXPORT_SYMBOL_GPL(wl1251_free_hw);
 MODULE_DESCRIPTION("TI wl1251 Wireles LAN Driver Core");
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Kalle Valo <kalle.valo@nokia.com>");
-MODULE_ALIAS("spi:wl1251");
 MODULE_FIRMWARE(WL1251_FW_NAME);