aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/libertas/main.c')
-rw-r--r--drivers/net/wireless/libertas/main.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index 5d2bf539d4b9..b51513fb59ec 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -662,8 +662,10 @@ static int lbs_thread(void *data)
662 set_current_state(TASK_INTERRUPTIBLE); 662 set_current_state(TASK_INTERRUPTIBLE);
663 spin_lock_irq(&priv->driver_lock); 663 spin_lock_irq(&priv->driver_lock);
664 664
665 if (priv->surpriseremoved) 665 if (kthread_should_stop())
666 shouldsleep = 0; /* Bye */ 666 shouldsleep = 0; /* Bye */
667 else if (priv->surpriseremoved)
668 shouldsleep = 1; /* We need to wait until we're _told_ to die */
667 else if (priv->psstate == PS_STATE_SLEEP) 669 else if (priv->psstate == PS_STATE_SLEEP)
668 shouldsleep = 1; /* Sleep mode. Nothing we can do till it wakes */ 670 shouldsleep = 1; /* Sleep mode. Nothing we can do till it wakes */
669 else if (priv->intcounter) 671 else if (priv->intcounter)
@@ -699,12 +701,15 @@ static int lbs_thread(void *data)
699 lbs_deb_thread("main-thread 333: intcounter=%d currenttxskb=%p dnld_sent=%d\n", 701 lbs_deb_thread("main-thread 333: intcounter=%d currenttxskb=%p dnld_sent=%d\n",
700 priv->intcounter, priv->currenttxskb, priv->dnld_sent); 702 priv->intcounter, priv->currenttxskb, priv->dnld_sent);
701 703
702 if (kthread_should_stop() || priv->surpriseremoved) { 704 if (kthread_should_stop()) {
703 lbs_deb_thread("main-thread: break from main thread: surpriseremoved=0x%x\n", 705 lbs_deb_thread("main-thread: break from main thread\n");
704 priv->surpriseremoved);
705 break; 706 break;
706 } 707 }
707 708
709 if (priv->surpriseremoved) {
710 lbs_deb_thread("adapter removed; waiting to die...\n");
711 continue;
712 }
708 713
709 spin_lock_irq(&priv->driver_lock); 714 spin_lock_irq(&priv->driver_lock);
710 715