ipw2x00: convert tasklets to use new tasklet_setup() API
authorAllen Pais <allen.lkml@gmail.com>
Mon, 17 Aug 2020 09:06:29 +0000 (14:36 +0530)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 27 Aug 2020 13:22:06 +0000 (16:22 +0300)
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 <allen.lkml@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200817090637.26887-9-allen.cryptic@gmail.com
drivers/net/wireless/intel/ipw2x00/ipw2100.c
drivers/net/wireless/intel/ipw2x00/ipw2200.c

index 461e955..b7fbfc7 100644 (file)
@@ -3204,9 +3204,9 @@ static void ipw2100_tx_send_data(struct ipw2100_priv *priv)
        }
 }
 
-static void ipw2100_irq_tasklet(unsigned long data)
+static void ipw2100_irq_tasklet(struct tasklet_struct *t)
 {
-       struct ipw2100_priv *priv = (struct ipw2100_priv *)data;
+       struct ipw2100_priv *priv = from_tasklet(priv, t, irq_tasklet);
        struct net_device *dev = priv->net_dev;
        unsigned long flags;
        u32 inta, tmp;
@@ -6005,7 +6005,7 @@ static void ipw2100_rf_kill(struct work_struct *work)
        spin_unlock_irqrestore(&priv->low_lock, flags);
 }
 
-static void ipw2100_irq_tasklet(unsigned long data);
+static void ipw2100_irq_tasklet(struct tasklet_struct *t);
 
 static const struct net_device_ops ipw2100_netdev_ops = {
        .ndo_open               = ipw2100_open,
@@ -6135,8 +6135,7 @@ static struct net_device *ipw2100_alloc_device(struct pci_dev *pci_dev,
        INIT_DELAYED_WORK(&priv->rf_kill, ipw2100_rf_kill);
        INIT_DELAYED_WORK(&priv->scan_event, ipw2100_scan_event);
 
-       tasklet_init(&priv->irq_tasklet,
-                    ipw2100_irq_tasklet, (unsigned long)priv);
+       tasklet_setup(&priv->irq_tasklet, ipw2100_irq_tasklet);
 
        /* NOTE:  We do not start the deferred work for status checks yet */
        priv->stop_rf_kill = 1;
index e768070..ada6ce3 100644 (file)
@@ -1945,9 +1945,9 @@ static void notify_wx_assoc_event(struct ipw_priv *priv)
        wireless_send_event(priv->net_dev, SIOCGIWAP, &wrqu, NULL);
 }
 
-static void ipw_irq_tasklet(unsigned long data)
+static void ipw_irq_tasklet(struct tasklet_struct *t)
 {
-       struct ipw_priv *priv = (struct ipw_priv *)data;
+       struct ipw_priv *priv = from_tasklet(priv, t, irq_tasklet);
        u32 inta, inta_mask, handled = 0;
        unsigned long flags;
 
@@ -10672,8 +10672,7 @@ static void ipw_setup_deferred_work(struct ipw_priv *priv)
        INIT_WORK(&priv->qos_activate, ipw_bg_qos_activate);
 #endif                         /* CONFIG_IPW2200_QOS */
 
-       tasklet_init(&priv->irq_tasklet,
-                    ipw_irq_tasklet, (unsigned long)priv);
+       tasklet_setup(&priv->irq_tasklet, ipw_irq_tasklet);
 }
 
 static void shim__set_security(struct net_device *dev,