[PATCH v4 01/19] crypto: amcc: convert tasklets to use new tasklet_setup() API

Allen Pais apais at linux.microsoft.com
Fri Jan 29 04:08:41 EST 2021


>> ---
>>   drivers/crypto/amcc/crypto4xx_core.c | 7 +++----
>>   1 file changed, 3 insertions(+), 4 deletions(-)
> 
> This doesn't even compile:
> 
>    CC [M]  drivers/crypto/amcc/crypto4xx_core.o
>    CC [M]  drivers/crypto/amcc/crypto4xx_alg.o
>    CC [M]  drivers/crypto/amcc/crypto4xx_trng.o
>    CHECK   ../drivers/crypto/amcc/crypto4xx_trng.c
> ../drivers/crypto/amcc/crypto4xx_core.c: In function ‘crypto4xx_cipher_done’:
> ../drivers/crypto/amcc/crypto4xx_core.c:526:13: warning: variable ‘addr’ set but not used [-Wunused-but-set-variable]
>    dma_addr_t addr;
>               ^~~~
> ../drivers/crypto/amcc/crypto4xx_core.c: In function ‘crypto4xx_ahash_done’:
> ../drivers/crypto/amcc/crypto4xx_core.c:557:24: warning: variable ‘ctx’ set but not used [-Wunused-but-set-variable]
>    struct crypto4xx_ctx *ctx;
>                          ^~~
> In file included from <command-line>:
> ../drivers/crypto/amcc/crypto4xx_core.c: In function ‘crypto4xx_bh_tasklet_cb’:
> ../include/linux/kernel.h:694:51: error: ‘struct device’ has no member named ‘tasklet’
>    BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
>                                                     ^~

Thanks. It should have been


--- a/drivers/crypto/amcc/crypto4xx_core.c
+++ b/drivers/crypto/amcc/crypto4xx_core.c
@@ -1072,10 +1072,11 @@ static void crypto4xx_unregister_alg(struct 
crypto4xx_device *sec_dev)
         }
  }

-static void crypto4xx_bh_tasklet_cb(unsigned long data)
+static void crypto4xx_bh_tasklet_cb(struct tasklet_struct *t)
  {
-       struct device *dev = (struct device *)data;
-       struct crypto4xx_core_device *core_dev = dev_get_drvdata(dev);
+       struct crypto4xx_core_device *core_dev = from_tasklet(core_dev, t,
+                                                             tasklet);
+       struct device *dev = core_dev->device;
         struct pd_uinfo *pd_uinfo;
         struct ce_pd *pd;
         u32 tail = core_dev->dev->pdr_tail;
@@ -1452,8 +1453,7 @@ static int crypto4xx_probe(struct platform_device 
*ofdev)
                 goto err_build_sdr;

         /* Init tasklet for bottom half processing */
-       tasklet_init(&core_dev->tasklet, crypto4xx_bh_tasklet_cb,
-                    (unsigned long) dev);
+       tasklet_setup(&core_dev->tasklet, crypto4xx_bh_tasklet_cb);

         core_dev->dev->ce_base = of_iomap(ofdev->dev.of_node, 0);
         if (!core_dev->dev->ce_base) {


Will fix it up and re-send.

Thanks.



More information about the Linux-rockchip mailing list