OSDN Git Service

net: macb: convert tasklets to use new tasklet_setup() API
authorAllen Pais <apais@linux.microsoft.com>
Mon, 14 Sep 2020 07:29:23 +0000 (12:59 +0530)
committerDavid S. Miller <davem@davemloft.net>
Mon, 14 Sep 2020 20:02:37 +0000 (13:02 -0700)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cadence/macb_main.c

index 6761f40..830c537 100644 (file)
@@ -1466,9 +1466,9 @@ static int macb_poll(struct napi_struct *napi, int budget)
        return work_done;
 }
 
-static void macb_hresp_error_task(unsigned long data)
+static void macb_hresp_error_task(struct tasklet_struct *t)
 {
-       struct macb *bp = (struct macb *)data;
+       struct macb *bp = from_tasklet(bp, t, hresp_err_tasklet);
        struct net_device *dev = bp->dev;
        struct macb_queue *queue;
        unsigned int q;
@@ -4560,8 +4560,7 @@ static int macb_probe(struct platform_device *pdev)
                goto err_out_unregister_mdio;
        }
 
-       tasklet_init(&bp->hresp_err_tasklet, macb_hresp_error_task,
-                    (unsigned long)bp);
+       tasklet_setup(&bp->hresp_err_tasklet, macb_hresp_error_task);
 
        netdev_info(dev, "Cadence %s rev 0x%08x at 0x%08lx irq %d (%pM)\n",
                    macb_is_gem(bp) ? "GEM" : "MACB", macb_readl(bp, MID),