[PATCH 04/19] crypto: caam: convert tasklets to use new tasklet_setup() API

From: Allen Pais
Date: Mon Aug 17 2020 - 04:10:27 EST


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@xxxxxxxxx>
Signed-off-by: Allen Pais <allen.lkml@xxxxxxxxx>
---
drivers/crypto/caam/jr.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/crypto/caam/jr.c b/drivers/crypto/caam/jr.c
index bf6b03b17251..4dc923736ba8 100644
--- a/drivers/crypto/caam/jr.c
+++ b/drivers/crypto/caam/jr.c
@@ -201,11 +201,10 @@ static irqreturn_t caam_jr_interrupt(int irq, void *st_dev)
}

/* Deferred service handler, run as interrupt-fired tasklet */
-static void caam_jr_dequeue(unsigned long devarg)
+static void caam_jr_dequeue(struct tasklet_struct *t)
{
int hw_idx, sw_idx, i, head, tail;
- struct device *dev = (struct device *)devarg;
- struct caam_drv_private_jr *jrp = dev_get_drvdata(dev);
+ struct caam_drv_private_jr *jrp = from_tasklet(jrp, t, irqtask);
void (*usercall)(struct device *dev, u32 *desc, u32 status, void *arg);
u32 *userdesc, userstatus;
void *userarg;
@@ -483,7 +482,7 @@ static int caam_jr_init(struct device *dev)
(JOBR_INTC_COUNT_THLD << JRCFG_ICDCT_SHIFT) |
(JOBR_INTC_TIME_THLD << JRCFG_ICTT_SHIFT));

- tasklet_init(&jrp->irqtask, caam_jr_dequeue, (unsigned long)dev);
+ tasklet_setup(&jrp->irqtask, caam_jr_dequeue);

/* Connect job ring interrupt handler. */
error = devm_request_irq(dev, jrp->irq, caam_jr_interrupt, IRQF_SHARED,
--
2.17.1