Commit 7e916caf authored by Kees Cook's avatar Kees Cook Committed by Kalle Valo

qtnfmac: 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.

Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: Igor Mitsyanko <imitsyanko@quantenna.com>
Cc: Avinash Patil <avinashp@quantenna.com>
Cc: Sergey Matyukevich <smatyukevich@quantenna.com>
Cc: Kamlesh Rath <krath@quantenna.com>
Cc: linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 7c51d17c
......@@ -538,9 +538,9 @@ qtnf_del_station(struct wiphy *wiphy, struct net_device *dev,
return ret;
}
static void qtnf_scan_timeout(unsigned long data)
static void qtnf_scan_timeout(struct timer_list *t)
{
struct qtnf_wmac *mac = (struct qtnf_wmac *)data;
struct qtnf_wmac *mac = from_timer(mac, t, scan_timeout);
pr_warn("mac%d scan timed out\n", mac->macid);
qtnf_scan_done(mac, true);
......@@ -559,8 +559,7 @@ qtnf_scan(struct wiphy *wiphy, struct cfg80211_scan_request *request)
return -EFAULT;
}
mac->scan_timeout.data = (unsigned long)mac;
mac->scan_timeout.function = qtnf_scan_timeout;
mac->scan_timeout.function = (TIMER_FUNC_TYPE)qtnf_scan_timeout;
mod_timer(&mac->scan_timeout,
jiffies + QTNF_SCAN_TIMEOUT_SEC * HZ);
......
......@@ -289,7 +289,7 @@ static struct qtnf_wmac *qtnf_core_mac_alloc(struct qtnf_bus *bus,
mac->iflist[i].vifid = i;
qtnf_sta_list_init(&mac->iflist[i].sta_list);
mutex_init(&mac->mac_lock);
init_timer(&mac->scan_timeout);
setup_timer(&mac->scan_timeout, NULL, 0);
}
qtnf_mac_init_primary_intf(mac);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment