Linux wireless drivers development
 help / color / mirror / Atom feed
From: Eliad Peller <eliad@wizery.com>
To: Luciano Coelho <coelho@ti.com>
Cc: <linux-wireless@vger.kernel.org>
Subject: [PATCH] wl12xx: free firmware after booting the chip
Date: Mon, 17 Jan 2011 19:17:55 +0200	[thread overview]
Message-ID: <1295284675-30029-1-git-send-email-eliad@wizery.com> (raw)

There is no need to save the fw in memory after it has been
uploaded to the chip.

Signed-off-by: Eliad Peller <eliad@wizery.com>
---
 drivers/net/wireless/wl12xx/main.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 8a35491..e1944b1 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -691,7 +691,6 @@ static int wl1271_fetch_firmware(struct wl1271 *wl)
 		goto out;
 	}
 
-	vfree(wl->fw);
 	wl->fw_len = fw->size;
 	wl->fw = vmalloc(wl->fw_len);
 
@@ -891,7 +890,7 @@ int wl1271_plt_start(struct wl1271 *wl)
 		wl->state = WL1271_STATE_PLT;
 		wl1271_notice("firmware booted in PLT mode (%s)",
 			      wl->chip.fw_ver);
-		goto out;
+		goto out_free_fw;
 
 irq_disable:
 		wl1271_disable_interrupts(wl);
@@ -911,6 +910,9 @@ power_off:
 
 	wl1271_error("firmware boot in PLT mode failed despite %d retries",
 		     WL1271_BOOT_RETRIES);
+out_free_fw:
+	vfree(wl->fw);
+	wl->fw = NULL;
 out:
 	mutex_unlock(&wl->mutex);
 
@@ -1126,7 +1128,7 @@ power_off:
 	if (!booted) {
 		wl1271_error("firmware boot failed despite %d retries",
 			     WL1271_BOOT_RETRIES);
-		goto out;
+		goto out_free_fw;
 	}
 
 	wl->vif = vif;
@@ -1148,6 +1150,9 @@ power_off:
 	wl1271_debug(DEBUG_MAC80211, "11a is %ssupported",
 		     wl->enable_11a ? "" : "not ");
 
+out_free_fw:
+	vfree(wl->fw);
+	wl->fw = NULL;
 out:
 	mutex_unlock(&wl->mutex);
 
@@ -3300,8 +3305,6 @@ int wl1271_free_hw(struct wl1271 *wl)
 
 	wl1271_debugfs_exit(wl);
 
-	vfree(wl->fw);
-	wl->fw = NULL;
 	kfree(wl->nvs);
 	wl->nvs = NULL;
 
-- 
1.7.0.4


             reply	other threads:[~2011-01-17 17:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-17 17:17 Eliad Peller [this message]
2011-01-17 17:58 ` [PATCH] wl12xx: free firmware after booting the chip Johannes Berg
2011-01-17 18:11   ` Eliad Peller
2011-01-17 18:13     ` Johannes Berg
2011-01-17 19:32       ` Eliad Peller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1295284675-30029-1-git-send-email-eliad@wizery.com \
    --to=eliad@wizery.com \
    --cc=coelho@ti.com \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox