Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 314176
b: refs/heads/master
c: 3e3947f
h: refs/heads/master
v: v3
  • Loading branch information
Arik Nemtsov authored and Luciano Coelho committed Jun 8, 2012
1 parent 301f791 commit 1a5fb37
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 17d97719dc2fe2b9c13831dc2c8572b54efe00b4
refs/heads/master: 3e3947fffc2ebe8c52891b3fca195172875dc951
4 changes: 3 additions & 1 deletion trunk/drivers/net/wireless/ti/wlcore/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,10 @@ int wlcore_boot_upload_nvs(struct wl1271 *wl)
u32 dest_addr, val;
u8 *nvs_ptr, *nvs_aligned;

if (wl->nvs == NULL)
if (wl->nvs == NULL) {
wl1271_error("NVS file is needed during boot");
return -ENODEV;
}

if (wl->quirks & WLCORE_QUIRK_LEGACY_NVS) {
struct wl1271_nvs_file *nvs =
Expand Down
22 changes: 6 additions & 16 deletions trunk/drivers/net/wireless/ti/wlcore/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -715,33 +715,30 @@ static int wl12xx_fetch_firmware(struct wl1271 *wl, bool plt)
return ret;
}

static int wl1271_fetch_nvs(struct wl1271 *wl)
static void wl1271_fetch_nvs(struct wl1271 *wl)
{
const struct firmware *fw;
int ret;

ret = request_firmware(&fw, WL12XX_NVS_NAME, wl->dev);

if (ret < 0) {
wl1271_error("could not get nvs file %s: %d", WL12XX_NVS_NAME,
ret);
return ret;
wl1271_debug(DEBUG_BOOT, "could not get nvs file %s: %d",
WL12XX_NVS_NAME, ret);
return;
}

wl->nvs = kmemdup(fw->data, fw->size, GFP_KERNEL);

if (!wl->nvs) {
wl1271_error("could not allocate memory for the nvs file");
ret = -ENOMEM;
goto out;
}

wl->nvs_len = fw->size;

out:
release_firmware(fw);

return ret;
}

void wl12xx_queue_recovery_work(struct wl1271 *wl)
Expand Down Expand Up @@ -989,13 +986,6 @@ static int wl12xx_chip_wakeup(struct wl1271 *wl, bool plt)
if (ret < 0)
goto out;

/* No NVS from netlink, try to get it from the filesystem */
if (wl->nvs == NULL) {
ret = wl1271_fetch_nvs(wl);
if (ret < 0)
goto out;
}

out:
return ret;
}
Expand Down Expand Up @@ -4937,8 +4927,8 @@ static int wl1271_register_hw(struct wl1271 *wl)
if (wl->mac80211_registered)
return 0;

ret = wl1271_fetch_nvs(wl);
if (ret == 0) {
wl1271_fetch_nvs(wl);
if (wl->nvs != NULL) {
/* NOTE: The wl->nvs->nvs element must be first, in
* order to simplify the casting, we assume it is at
* the beginning of the wl->nvs structure.
Expand Down

0 comments on commit 1a5fb37

Please sign in to comment.