pcmcia: fix a boot time warning in pcmcia cs code
[linux-2.6-block.git] / drivers / pcmcia / cs.c
index 5292db69c426cb31df6e19004edaaf282ee0bc49..367d45e03bee4d24f0005aa85a302ca10a93163e 100644 (file)
@@ -626,8 +626,6 @@ static int pccardd(void *__skt)
                unsigned int events;
                unsigned int sysfs_events;
 
-               set_current_state(TASK_INTERRUPTIBLE);
-
                spin_lock_irqsave(&skt->thread_lock, flags);
                events = skt->thread_events;
                skt->thread_events = 0;
@@ -675,11 +673,15 @@ static int pccardd(void *__skt)
                if (kthread_should_stop())
                        break;
 
+               set_current_state(TASK_INTERRUPTIBLE);
+
                schedule();
+
+               /* make sure we are running */
+               __set_current_state(TASK_RUNNING);
+
                try_to_freeze();
        }
-       /* make sure we are running before we exit */
-       set_current_state(TASK_RUNNING);
 
        /* shut down socket, if a device is still present */
        if (skt->state & SOCKET_PRESENT) {