diff options
author | Allen Pais <apais@linux.microsoft.com> | 2020-09-16 11:50:54 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-09-16 13:13:00 +0200 |
commit | 49391bf28d98a48013fd31d8f30cb25b0c4cfdd7 (patch) | |
tree | 1ff8cee0b6e5ff13ebfd1bf78ae10a1c5fe0bee1 /drivers | |
parent | e24eca1fff975e5c44d3cc69c63aa1b4442394e4 (diff) |
staging: rtl8192e: convert tasklets to use new tasklet_setup() API
In preparation for unconditionally passing the
struct tasklet_struct pointer to all tasklet
callbacks, switch to using the new tasklet_setup()
and from_tasklet() to pass the tasklet pointer explicitly.
Signed-off-by: Romain Perier <romain.perier@gmail.com>
Signed-off-by: Allen Pais <apais@linux.microsoft.com>
Link: https://lore.kernel.org/r/20200916062054.58084-1-allen.lkml@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 27 | ||||
-rw-r--r-- | drivers/staging/rtl8192e/rtllib_softmac.c | 6 |
2 files changed, 16 insertions, 17 deletions
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index fac58eebf263..663675efcfe4 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -82,8 +82,8 @@ static int _rtl92e_hard_start_xmit(struct sk_buff *skb, struct net_device *dev); static void _rtl92e_tx_cmd(struct net_device *dev, struct sk_buff *skb); static short _rtl92e_tx(struct net_device *dev, struct sk_buff *skb); static short _rtl92e_pci_initdescring(struct net_device *dev); -static void _rtl92e_irq_tx_tasklet(unsigned long data); -static void _rtl92e_irq_rx_tasklet(unsigned long data); +static void _rtl92e_irq_tx_tasklet(struct tasklet_struct *t); +static void _rtl92e_irq_rx_tasklet(struct tasklet_struct *t); static void _rtl92e_cancel_deferred_work(struct r8192_priv *priv); static int _rtl92e_up(struct net_device *dev, bool is_silent_reset); static int _rtl92e_try_up(struct net_device *dev); @@ -517,9 +517,10 @@ static int _rtl92e_handle_assoc_response(struct net_device *dev, return 0; } -static void _rtl92e_prepare_beacon(unsigned long data) +static void _rtl92e_prepare_beacon(struct tasklet_struct *t) { - struct r8192_priv *priv = (struct r8192_priv *)data; + struct r8192_priv *priv = from_tasklet(priv, t, + irq_prepare_beacon_tasklet); struct net_device *dev = priv->rtllib->dev; struct sk_buff *pskb = NULL, *pnewskb = NULL; struct cb_desc *tcb_desc = NULL; @@ -1009,12 +1010,10 @@ static void _rtl92e_init_priv_task(struct net_device *dev) (void *)rtl92e_hw_wakeup_wq, dev); INIT_DELAYED_WORK_RSL(&priv->rtllib->hw_sleep_wq, (void *)rtl92e_hw_sleep_wq, dev); - tasklet_init(&priv->irq_rx_tasklet, _rtl92e_irq_rx_tasklet, - (unsigned long)priv); - tasklet_init(&priv->irq_tx_tasklet, _rtl92e_irq_tx_tasklet, - (unsigned long)priv); - tasklet_init(&priv->irq_prepare_beacon_tasklet, _rtl92e_prepare_beacon, - (unsigned long)priv); + tasklet_setup(&priv->irq_rx_tasklet, _rtl92e_irq_rx_tasklet); + tasklet_setup(&priv->irq_tx_tasklet, _rtl92e_irq_tx_tasklet); + tasklet_setup(&priv->irq_prepare_beacon_tasklet, + _rtl92e_prepare_beacon); } static short _rtl92e_get_channel_map(struct net_device *dev) @@ -2109,16 +2108,16 @@ static void _rtl92e_tx_resume(struct net_device *dev) } } -static void _rtl92e_irq_tx_tasklet(unsigned long data) +static void _rtl92e_irq_tx_tasklet(struct tasklet_struct *t) { - struct r8192_priv *priv = (struct r8192_priv *)data; + struct r8192_priv *priv = from_tasklet(priv, t, irq_tx_tasklet); _rtl92e_tx_resume(priv->rtllib->dev); } -static void _rtl92e_irq_rx_tasklet(unsigned long data) +static void _rtl92e_irq_rx_tasklet(struct tasklet_struct *t) { - struct r8192_priv *priv = (struct r8192_priv *)data; + struct r8192_priv *priv = from_tasklet(priv, t, irq_rx_tasklet); _rtl92e_rx_normal(priv->rtllib->dev); diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c index 6e2f620afd14..2c752ba5a802 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac.c +++ b/drivers/staging/rtl8192e/rtllib_softmac.c @@ -2044,9 +2044,9 @@ static short rtllib_sta_ps_sleep(struct rtllib_device *ieee, u64 *time) } -static inline void rtllib_sta_ps(unsigned long data) +static inline void rtllib_sta_ps(struct tasklet_struct *t) { - struct rtllib_device *ieee = (struct rtllib_device *)data; + struct rtllib_device *ieee = from_tasklet(ieee, t, ps_task); u64 time; short sleep; unsigned long flags, flags2; @@ -3028,7 +3028,7 @@ void rtllib_softmac_init(struct rtllib_device *ieee) spin_lock_init(&ieee->mgmt_tx_lock); spin_lock_init(&ieee->beacon_lock); - tasklet_init(&ieee->ps_task, rtllib_sta_ps, (unsigned long)ieee); + tasklet_setup(&ieee->ps_task, rtllib_sta_ps); } |