/*             Callback function of LED BlinkTimer, */
 /*             it just schedules to corresponding BlinkWorkItem/led_blink_hdl */
 /*  */
-void BlinkTimerCallback(unsigned long data)
+static void BlinkTimerCallback(struct timer_list *t)
 {
-       struct LED_871x *pLed = (struct LED_871x *)data;
+       struct LED_871x *pLed = from_timer(pLed, t, BlinkTimer);
        struct adapter *padapter = pLed->padapter;
 
        if ((padapter->bSurpriseRemoved) || (padapter->bDriverStopped))
 
        ResetLedStatus(pLed);
 
-       setup_timer(&pLed->BlinkTimer, BlinkTimerCallback,
-                   (unsigned long)pLed);
+       timer_setup(&pLed->BlinkTimer, BlinkTimerCallback, 0);
 
        INIT_WORK(&pLed->BlinkWorkItem, BlinkWorkItemCallback);
 }
 
  * _rtw_join_timeout_handler - Timeout/failure handler for CMD JoinBss
  * @adapter: pointer to struct adapter structure
  */
-void _rtw_join_timeout_handler (unsigned long data)
+void _rtw_join_timeout_handler (struct timer_list *t)
 {
-       struct adapter *adapter = (struct adapter *)data;
+       struct adapter *adapter =
+               from_timer(adapter, t, mlmepriv.assoc_timer);
        struct  mlme_priv *pmlmepriv = &adapter->mlmepriv;
        int do_join_r;
 
  * rtw_scan_timeout_handler - Timeout/Faliure handler for CMD SiteSurvey
  * @adapter: pointer to struct adapter structure
  */
-void rtw_scan_timeout_handler (unsigned long data)
+void rtw_scan_timeout_handler (struct timer_list *t)
 {
-       struct adapter *adapter = (struct adapter *)data;
+       struct adapter *adapter =
+               from_timer(adapter, t, mlmepriv.scan_to_timer);
        struct  mlme_priv *pmlmepriv = &adapter->mlmepriv;
 
        DBG_88E(FUNC_ADPT_FMT" fw_state=%x\n", FUNC_ADPT_ARG(adapter), get_fwstate(pmlmepriv));
        }
 }
 
-void rtw_dynamic_check_timer_handlder(unsigned long data)
+void rtw_dynamic_check_timer_handlder(struct timer_list *t)
 {
-       struct adapter *adapter = (struct adapter *)data;
+       struct adapter *adapter =
+               from_timer(adapter, t, mlmepriv.dynamic_chk_timer);
        struct registry_priv *pregistrypriv = &adapter->registrypriv;
 
        if (!adapter)
 
        }
 }
 
-void survey_timer_hdl(unsigned long data)
+void survey_timer_hdl(struct timer_list *t)
 {
-       struct adapter *padapter = (struct adapter *)data;
+       struct adapter *padapter = from_timer(padapter, t,
+                                           mlmeextpriv.link_timer);
        struct cmd_obj  *ph2c;
        struct sitesurvey_parm  *psurveyPara;
        struct cmd_priv                                 *pcmdpriv = &padapter->cmdpriv;
        return;
 }
 
-void link_timer_hdl(unsigned long data)
+void link_timer_hdl(struct timer_list *t)
 {
-       struct adapter *padapter = (struct adapter *)data;
+       struct adapter *padapter = from_timer(padapter, t,
+                                           mlmeextpriv.link_timer);
        struct mlme_ext_priv    *pmlmeext = &padapter->mlmeextpriv;
        struct mlme_ext_info    *pmlmeinfo = &(pmlmeext->mlmext_info);
 
        }
 }
 
-void addba_timer_hdl(unsigned long data)
+void addba_timer_hdl(struct timer_list *t)
 {
-       struct sta_info *psta = (struct sta_info *)data;
+       struct sta_info *psta = from_timer(psta, t, addba_retry_timer);
        struct ht_priv  *phtpriv;
 
        if (!psta)
 
        pwrpriv->ps_processing = false;
 }
 
-static void pwr_state_check_handler(unsigned long data)
+static void pwr_state_check_handler(struct timer_list *t)
 {
-       struct adapter *padapter = (struct adapter *)data;
+       struct adapter *padapter =
+               from_timer(padapter, t,
+                               pwrctrlpriv.pwr_state_check_timer);
 
        rtw_ps_cmd(padapter);
 }
 
        pwrctrlpriv->btcoex_rfon = false;
 
-       setup_timer(&pwrctrlpriv->pwr_state_check_timer,
-                   pwr_state_check_handler,
-                   (unsigned long)padapter);
+       timer_setup(&pwrctrlpriv->pwr_state_check_timer,
+                   pwr_state_check_handler, 0);
 }
 
 /*
 
        0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00
 };
 
-static void rtw_signal_stat_timer_hdl(unsigned long data);
+static void rtw_signal_stat_timer_hdl(struct timer_list *t);
 
 void _rtw_init_sta_recv_priv(struct sta_recv_priv *psta_recvpriv)
 {
        }
        res = rtw_hal_init_recv_priv(padapter);
 
-       setup_timer(&precvpriv->signal_stat_timer,
-                   rtw_signal_stat_timer_hdl,
-                   (unsigned long)padapter);
+       timer_setup(&precvpriv->signal_stat_timer, rtw_signal_stat_timer_hdl,
+                   0);
 
        precvpriv->signal_stat_sampling_interval = 1000; /* ms */
 
        return _FAIL;
 }
 
-void rtw_reordering_ctrl_timeout_handler(unsigned long data)
+void rtw_reordering_ctrl_timeout_handler(struct timer_list *t)
 {
-       struct recv_reorder_ctrl *preorder_ctrl = (struct recv_reorder_ctrl *)data;
+       struct recv_reorder_ctrl *preorder_ctrl = from_timer(preorder_ctrl, t,
+                                                          reordering_ctrl_timer);
        struct adapter *padapter = preorder_ctrl->padapter;
        struct __queue *ppending_recvframe_queue = &preorder_ctrl->pending_recvframe_queue;
 
        return ret;
 }
 
-static void rtw_signal_stat_timer_hdl(unsigned long data)
+static void rtw_signal_stat_timer_hdl(struct timer_list *t)
 {
-       struct adapter *adapter = (struct adapter *)data;
+       struct adapter *adapter =
+               from_timer(adapter, t, recvpriv.signal_stat_timer);
        struct recv_priv *recvpriv = &adapter->recvpriv;
 
        u32 tmp_s, tmp_q;
 
        /* add for led control */
 };
 
-void BlinkTimerCallback(unsigned long data);
 void BlinkWorkItemCallback(struct work_struct *work);
 
 void ResetLedStatus(struct LED_871x *pLed);
 
 
 void rtw_get_encrypt_decrypt_from_registrypriv(struct adapter *adapter);
 
-void _rtw_join_timeout_handler(unsigned long data);
-void rtw_scan_timeout_handler(unsigned long data);
+void _rtw_join_timeout_handler(struct timer_list *t);
+void rtw_scan_timeout_handler(struct timer_list *t);
 
-void rtw_dynamic_check_timer_handlder(unsigned long data);
+void rtw_dynamic_check_timer_handlder(struct timer_list *t);
 #define rtw_is_scan_deny(adapter) false
 #define rtw_clear_scan_deny(adapter) do {} while (0)
 #define rtw_set_scan_deny_timer_hdl(adapter) do {} while (0)
 
 
 void linked_status_chk(struct adapter *padapter);
 
-void survey_timer_hdl(unsigned long data);
-void link_timer_hdl(unsigned long data);
-void addba_timer_hdl(unsigned long data);
+void survey_timer_hdl(struct timer_list *t);
+void link_timer_hdl(struct timer_list *t);
+void addba_timer_hdl(struct timer_list *t);
 
 #define set_survey_timer(mlmeext, ms) \
        mod_timer(&mlmeext->survey_timer, jiffies +     \
 
                              struct __queue *pfree_recv_queue);
 u32 rtw_free_uc_swdec_pending_queue(struct adapter *adapter);
 
-void rtw_reordering_ctrl_timeout_handler(unsigned long data);
+void rtw_reordering_ctrl_timeout_handler(struct timer_list *t);
 
 static inline s32 translate_percentage_to_dbm(u32 sig_stren_index)
 {
 
 {
        struct  mlme_priv *pmlmepriv = &padapter->mlmepriv;
 
-       setup_timer(&pmlmepriv->assoc_timer, _rtw_join_timeout_handler,
-                   (unsigned long)padapter);
-       setup_timer(&pmlmepriv->scan_to_timer, rtw_scan_timeout_handler,
-                   (unsigned long)padapter);
-       setup_timer(&pmlmepriv->dynamic_chk_timer,
-                   rtw_dynamic_check_timer_handlder, (unsigned long)padapter);
+       timer_setup(&pmlmepriv->assoc_timer, _rtw_join_timeout_handler, 0);
+       timer_setup(&pmlmepriv->scan_to_timer, rtw_scan_timeout_handler, 0);
+       timer_setup(&pmlmepriv->dynamic_chk_timer,
+                   rtw_dynamic_check_timer_handlder, 0);
 }
 
 void rtw_os_indicate_connect(struct adapter *adapter)
 
 void init_addba_retry_timer(struct adapter *padapter, struct sta_info *psta)
 {
-       setup_timer(&psta->addba_retry_timer, addba_timer_hdl,
-                   (unsigned long)psta);
+       timer_setup(&psta->addba_retry_timer, addba_timer_hdl, 0);
 }
 
 void init_mlme_ext_timer(struct adapter *padapter)
 {
        struct  mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
 
-       setup_timer(&pmlmeext->survey_timer, survey_timer_hdl,
-                   (unsigned long)padapter);
-       setup_timer(&pmlmeext->link_timer, link_timer_hdl,
-                   (unsigned long)padapter);
+       timer_setup(&pmlmeext->survey_timer, survey_timer_hdl, 0);
+       timer_setup(&pmlmeext->link_timer, link_timer_hdl, 0);
 }
 
 #ifdef CONFIG_88EU_AP_MODE
 
 void rtw_init_recv_timer(struct recv_reorder_ctrl *preorder_ctrl)
 {
 
-       setup_timer(&preorder_ctrl->reordering_ctrl_timer,
-                   rtw_reordering_ctrl_timeout_handler,
-                   (unsigned long)preorder_ctrl);
+       timer_setup(&preorder_ctrl->reordering_ctrl_timer,
+                   rtw_reordering_ctrl_timeout_handler, 0);
 }