aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorArik Nemtsov <arik@wizery.com>2012-05-29 11:38:05 -0400
committerLuciano Coelho <coelho@ti.com>2012-06-08 02:52:06 -0400
commit3e3947fffc2ebe8c52891b3fca195172875dc951 (patch)
tree425a4d788ff757d7fd09694458125830aa288040 /drivers
parent17d97719dc2fe2b9c13831dc2c8572b54efe00b4 (diff)
wlcore/wl12xx/wl18xx: make NVS file optional for wl18xx
Don't spew errors when we can't find the NVS file in wlcore. Instead fail the wl12xx boot HW op if the NVS isn't found. Take this opportunity to remove some dead code from register_hw() which looks for the NVS again needlessly. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/ti/wlcore/boot.c4
-rw-r--r--drivers/net/wireless/ti/wlcore/main.c22
2 files changed, 9 insertions, 17 deletions
diff --git a/drivers/net/wireless/ti/wlcore/boot.c b/drivers/net/wireless/ti/wlcore/boot.c
index ed718f7ddcce..0fda500c01c9 100644
--- a/drivers/net/wireless/ti/wlcore/boot.c
+++ b/drivers/net/wireless/ti/wlcore/boot.c
@@ -211,8 +211,10 @@ int wlcore_boot_upload_nvs(struct wl1271 *wl)
211 u32 dest_addr, val; 211 u32 dest_addr, val;
212 u8 *nvs_ptr, *nvs_aligned; 212 u8 *nvs_ptr, *nvs_aligned;
213 213
214 if (wl->nvs == NULL) 214 if (wl->nvs == NULL) {
215 wl1271_error("NVS file is needed during boot");
215 return -ENODEV; 216 return -ENODEV;
217 }
216 218
217 if (wl->quirks & WLCORE_QUIRK_LEGACY_NVS) { 219 if (wl->quirks & WLCORE_QUIRK_LEGACY_NVS) {
218 struct wl1271_nvs_file *nvs = 220 struct wl1271_nvs_file *nvs =
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index 176a3117889b..1156e3f578c1 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -715,7 +715,7 @@ out:
715 return ret; 715 return ret;
716} 716}
717 717
718static int wl1271_fetch_nvs(struct wl1271 *wl) 718static void wl1271_fetch_nvs(struct wl1271 *wl)
719{ 719{
720 const struct firmware *fw; 720 const struct firmware *fw;
721 int ret; 721 int ret;
@@ -723,16 +723,15 @@ static int wl1271_fetch_nvs(struct wl1271 *wl)
723 ret = request_firmware(&fw, WL12XX_NVS_NAME, wl->dev); 723 ret = request_firmware(&fw, WL12XX_NVS_NAME, wl->dev);
724 724
725 if (ret < 0) { 725 if (ret < 0) {
726 wl1271_error("could not get nvs file %s: %d", WL12XX_NVS_NAME, 726 wl1271_debug(DEBUG_BOOT, "could not get nvs file %s: %d",
727 ret); 727 WL12XX_NVS_NAME, ret);
728 return ret; 728 return;
729 } 729 }
730 730
731 wl->nvs = kmemdup(fw->data, fw->size, GFP_KERNEL); 731 wl->nvs = kmemdup(fw->data, fw->size, GFP_KERNEL);
732 732
733 if (!wl->nvs) { 733 if (!wl->nvs) {
734 wl1271_error("could not allocate memory for the nvs file"); 734 wl1271_error("could not allocate memory for the nvs file");
735 ret = -ENOMEM;
736 goto out; 735 goto out;
737 } 736 }
738 737
@@ -740,8 +739,6 @@ static int wl1271_fetch_nvs(struct wl1271 *wl)
740 739
741out: 740out:
742 release_firmware(fw); 741 release_firmware(fw);
743
744 return ret;
745} 742}
746 743
747void wl12xx_queue_recovery_work(struct wl1271 *wl) 744void wl12xx_queue_recovery_work(struct wl1271 *wl)
@@ -989,13 +986,6 @@ static int wl12xx_chip_wakeup(struct wl1271 *wl, bool plt)
989 if (ret < 0) 986 if (ret < 0)
990 goto out; 987 goto out;
991 988
992 /* No NVS from netlink, try to get it from the filesystem */
993 if (wl->nvs == NULL) {
994 ret = wl1271_fetch_nvs(wl);
995 if (ret < 0)
996 goto out;
997 }
998
999out: 989out:
1000 return ret; 990 return ret;
1001} 991}
@@ -4937,8 +4927,8 @@ static int wl1271_register_hw(struct wl1271 *wl)
4937 if (wl->mac80211_registered) 4927 if (wl->mac80211_registered)
4938 return 0; 4928 return 0;
4939 4929
4940 ret = wl1271_fetch_nvs(wl); 4930 wl1271_fetch_nvs(wl);
4941 if (ret == 0) { 4931 if (wl->nvs != NULL) {
4942 /* NOTE: The wl->nvs->nvs element must be first, in 4932 /* NOTE: The wl->nvs->nvs element must be first, in
4943 * order to simplify the casting, we assume it is at 4933 * order to simplify the casting, we assume it is at
4944 * the beginning of the wl->nvs structure. 4934 * the beginning of the wl->nvs structure.