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>
This commit is contained in:
Allen Pais 2020-09-16 11:50:54 +05:30 committed by Greg Kroah-Hartman
parent e24eca1fff
commit 49391bf28d
2 changed files with 16 additions and 17 deletions

View File

@ -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);

View File

@ -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);
}