return error;
 }
 
-static void linux_wlan_spin_lock(void *vp, unsigned long *flags)
-{
-       unsigned long lflags;
-
-       PRINT_D(SPIN_DEBUG, "Lock spin %p\n", vp);
-       if (vp != NULL) {
-               spin_lock_irqsave((spinlock_t *)vp, lflags);
-               *flags = lflags;
-       } else {
-               PRINT_ER("Failed, spin lock is NULL\n");
-       }
-}
-static void linux_wlan_spin_unlock(void *vp, unsigned long *flags)
-{
-       unsigned long lflags = *flags;
-
-       PRINT_D(SPIN_DEBUG, "Unlock spin %p\n", vp);
-       if (vp != NULL) {
-               spin_unlock_irqrestore((spinlock_t *)vp, lflags);
-               *flags = lflags;
-       } else {
-               PRINT_ER("Failed, spin lock is NULL\n");
-       }
-}
-
 static void linux_wlan_mac_indicate(int flag)
 {
        /*I have to do it that way becuase there is no mean to encapsulate device pointer
        nwi->os_func.os_debug = linux_wlan_dbg;
        nwi->os_func.os_wait = linux_wlan_lock_timeout;
 
-       /*Added by Amr - BugID_4720*/
-       nwi->os_func.os_spin_lock = linux_wlan_spin_lock;
-       nwi->os_func.os_spin_unlock = linux_wlan_spin_unlock;
-
 #ifdef WILC_SDIO
        nwi->io_func.io_type = HIF_SDIO;
        nwi->io_func.io_init = linux_sdio_init;
 
        wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
        unsigned long flags;
 
-       p->os_func.os_spin_lock(p->txq_spinlock, &flags);
+       spin_lock_irqsave(p->txq_spinlock, flags);
        if (p->txq_head) {
                tqe = p->txq_head;
                p->txq_head = tqe->next;
        } else {
                tqe = NULL;
        }
-       p->os_func.os_spin_unlock(p->txq_spinlock, &flags);
+       spin_unlock_irqrestore(p->txq_spinlock, flags);
        return tqe;
 }
 
        wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
        unsigned long flags;
        /*Added by Amr - BugID_4720*/
-       p->os_func.os_spin_lock(p->txq_spinlock, &flags);
+       spin_lock_irqsave(p->txq_spinlock, flags);
 
        if (p->txq_head == NULL) {
                tqe->next = NULL;
        PRINT_D(TX_DBG, "Number of entries in TxQ = %d\n", p->txq_entries);
 
        /*Added by Amr - BugID_4720*/
-       p->os_func.os_spin_unlock(p->txq_spinlock, &flags);
+       spin_unlock_irqrestore(p->txq_spinlock, flags);
 
        /**
         *      wake up TX queue
        if (p->os_func.os_wait(p->txq_add_to_head_lock, CFG_PKTS_TIMEOUT))
                return -1;
 
-       p->os_func.os_spin_lock(p->txq_spinlock, &flags);
+       spin_lock_irqsave(p->txq_spinlock, flags);
 
        if (p->txq_head == NULL) {
                tqe->next = NULL;
        PRINT_D(TX_DBG, "Number of entries in TxQ = %d\n", p->txq_entries);
 
        /*Added by Amr - BugID_4720*/
-       p->os_func.os_spin_unlock(p->txq_spinlock, &flags);
+       spin_unlock_irqrestore(p->txq_spinlock, flags);
        up(p->txq_add_to_head_lock);
 
 
        wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
        unsigned long flags;
 
-       p->os_func.os_spin_lock(p->txq_spinlock, &flags);
+       spin_lock_irqsave(p->txq_spinlock, flags);
 
-       p->os_func.os_spin_unlock(p->txq_spinlock, &flags);
+       spin_unlock_irqrestore(p->txq_spinlock, flags);
        return 0;
 }
 
        wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
        unsigned long flags;
 
-       p->os_func.os_spin_lock(p->txq_spinlock, &flags);
+       spin_lock_irqsave(p->txq_spinlock, flags);
 
        eth_hdr_ptr = &buffer[0];
        h_proto = ntohs(*((unsigned short *)ð_hdr_ptr[12]));
        } else {
                ret = 0;
        }
-       p->os_func.os_spin_unlock(p->txq_spinlock, &flags);
+       spin_unlock_irqrestore(p->txq_spinlock, flags);
        return ret;
 }
 
        uint32_t Dropped = 0;
        wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
 
-       p->os_func.os_spin_lock(p->txq_spinlock, &p->txq_spinlock_flags);
+       spin_lock_irqsave(p->txq_spinlock, p->txq_spinlock_flags);
        for (i = PendingAcks_arrBase; i < (PendingAcks_arrBase + Pending_Acks); i++) {
                if (Pending_Acks_info[i].ack_num < Acks_keep_track_info[Pending_Acks_info[i].Session_index].Bigger_Ack_num) {
                        struct txq_entry_t *tqe;
                PendingAcks_arrBase = 0;
 
 
-       p->os_func.os_spin_unlock(p->txq_spinlock, &p->txq_spinlock_flags);
+       spin_unlock_irqrestore(p->txq_spinlock, p->txq_spinlock_flags);
 
        while (Dropped > 0) {
                /*consume the semaphore count of the removed packet*/
        unsigned long flags;
 
        /*Added by Amr - BugID_4720*/
-       p->os_func.os_spin_lock(p->txq_spinlock, &flags);
+       spin_lock_irqsave(p->txq_spinlock, flags);
 
        tqe = p->txq_head;
 
        /*Added by Amr - BugID_4720*/
-       p->os_func.os_spin_unlock(p->txq_spinlock, &flags);
+       spin_unlock_irqrestore(p->txq_spinlock, flags);
 
 
        return tqe;
        wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
        unsigned long flags;
        /*Added by Amr - BugID_4720*/
-       p->os_func.os_spin_lock(p->txq_spinlock, &flags);
+       spin_lock_irqsave(p->txq_spinlock, flags);
 
        tqe = tqe->next;
        /*Added by Amr - BugID_4720*/
-       p->os_func.os_spin_unlock(p->txq_spinlock, &flags);
+       spin_unlock_irqrestore(p->txq_spinlock, flags);
 
 
        return tqe;