#include <linux/skbuff.h>
 
 #include <linux/semaphore.h>
+#include <linux/completion.h>
 
 static int dev_state_ev_handler(struct notifier_block *this,
                                unsigned long event, void *ptr);
        vif = netdev_priv(dev);
        wl = vif->wilc;
 
-       up(&wl->txq_thread_started);
+       complete(&wl->txq_thread_started);
        while (1) {
                down(&wl->txq_event);
 
                if (wl->close) {
-                       up(&wl->txq_thread_started);
+                       complete(&wl->txq_thread_started);
 
                        while (!kthread_should_stop())
                                schedule();
 
        sema_init(&wl->cfg_event, 0);
        sema_init(&wl->sync_event, 0);
-
-       sema_init(&wl->txq_thread_started, 0);
+       init_completion(&wl->txq_thread_started);
 
        return 0;
 }
                wilc->close = 0;
                return -ENOBUFS;
        }
-       down(&wilc->txq_thread_started);
+       wait_for_completion(&wilc->txq_thread_started);
 
        return 0;
 }
 
        struct semaphore cfg_event;
        struct semaphore sync_event;
        struct semaphore txq_event;
-
-       struct semaphore txq_thread_started;
+       struct completion txq_thread_started;
 
        struct task_struct *txq_thread;