diff options
author | Kees Cook <keescook@chromium.org> | 2017-10-17 02:25:12 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-10-18 16:52:39 +0300 |
commit | f8af6a323368dd28fcea9742d582593c9adb2261 (patch) | |
tree | 9dc5a708a3fbda8ffb58c37e45a537269bc5e789 /drivers/staging/rtlwifi/base.c | |
parent | 682455befdc549bee146502d541a9a0c63f298de (diff) | |
download | linux-f8af6a323368dd28fcea9742d582593c9adb2261.tar.xz |
staging: rtlwifi: Convert timers to use timer_setup()
In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly. Also drops unused odm timer code.
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: Ping-Ke Shih <pkshih@realtek.com>
Cc: shaofu <shaofu@realtek.com>
Cc: devel@driverdev.osuosl.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtlwifi/base.c')
-rw-r--r-- | drivers/staging/rtlwifi/base.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/staging/rtlwifi/base.c b/drivers/staging/rtlwifi/base.c index b88b0e8edd3d..f80770fcd126 100644 --- a/drivers/staging/rtlwifi/base.c +++ b/drivers/staging/rtlwifi/base.c @@ -465,10 +465,10 @@ static void _rtl_init_deferred_work(struct ieee80211_hw *hw) struct rtl_priv *rtlpriv = rtl_priv(hw); /* <1> timer */ - setup_timer(&rtlpriv->works.watchdog_timer, - rtl_watch_dog_timer_callback, (unsigned long)hw); - setup_timer(&rtlpriv->works.dualmac_easyconcurrent_retrytimer, - rtl_easy_concurrent_retrytimer_callback, (unsigned long)hw); + timer_setup(&rtlpriv->works.watchdog_timer, + rtl_watch_dog_timer_callback, 0); + timer_setup(&rtlpriv->works.dualmac_easyconcurrent_retrytimer, + rtl_easy_concurrent_retrytimer_callback, 0); /* <2> work queue */ rtlpriv->works.hw = hw; rtlpriv->works.rtl_wq = alloc_workqueue("%s", 0, 0, rtlpriv->cfg->name); @@ -2161,10 +2161,10 @@ label_lps_done: rtl_scan_list_expire(hw); } -void rtl_watch_dog_timer_callback(unsigned long data) +void rtl_watch_dog_timer_callback(struct timer_list *t) { - struct ieee80211_hw *hw = (struct ieee80211_hw *)data; - struct rtl_priv *rtlpriv = rtl_priv(hw); + struct rtl_priv *rtlpriv = from_timer(rtlpriv, t, works.watchdog_timer); + struct ieee80211_hw *hw = rtlpriv->hw; queue_delayed_work(rtlpriv->works.rtl_wq, &rtlpriv->works.watchdog_wq, 0); @@ -2270,10 +2270,11 @@ void rtl_c2hcmd_wq_callback(void *data) rtl_c2hcmd_launcher(hw, 1); } -void rtl_easy_concurrent_retrytimer_callback(unsigned long data) +void rtl_easy_concurrent_retrytimer_callback(struct timer_list *t) { - struct ieee80211_hw *hw = (struct ieee80211_hw *)data; - struct rtl_priv *rtlpriv = rtl_priv(hw); + struct rtl_priv *rtlpriv = + from_timer(rtlpriv, t, works.dualmac_easyconcurrent_retrytimer); + struct ieee80211_hw *hw = rtlpriv->hw; struct rtl_priv *buddy_priv = rtlpriv->buddy_priv; if (!buddy_priv) |