Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux...
[pandora-kernel.git] / drivers / net / wireless / wl12xx / wl1271_event.c
index bced829..7b3f503 100644 (file)
@@ -41,6 +41,9 @@ void wl1271_pspoll_work(struct work_struct *work)
 
        mutex_lock(&wl->mutex);
 
+       if (unlikely(wl->state == WL1271_STATE_OFF))
+               goto out;
+
        if (!test_and_clear_bit(WL1271_FLAG_PSPOLL_FAILURE, &wl->flags))
                goto out;
 
@@ -93,7 +96,6 @@ static int wl1271_event_ps_report(struct wl1271 *wl,
 {
        int ret = 0;
        u32 total_retries = wl->conf.conn.psm_entry_retries;
-       u32 rates;
 
        wl1271_debug(DEBUG_EVENT, "ps_status: 0x%x", mbox->ps_status);
 
@@ -109,12 +111,8 @@ static int wl1271_event_ps_report(struct wl1271 *wl,
 
                if (wl->psm_entry_retry < total_retries) {
                        wl->psm_entry_retry++;
-                       if (wl->psm_entry_retry == total_retries)
-                               rates = wl->basic_rate;
-                       else
-                               rates = wl->basic_rate_set;
                        ret = wl1271_ps_set_mode(wl, STATION_POWER_SAVE_MODE,
-                                                rates, true);
+                                                wl->basic_rate, true);
                } else {
                        wl1271_info("No ack to nullfunc from AP.");
                        wl->psm_entry_retry = 0;